def rule(event):
    if all(
        [
            any(
                [
                    event.deep_get("Image", default="").endswith("\\powershell.exe"),
                    event.deep_get("Image", default="").endswith("\\pwsh.exe"),
                    event.deep_get("Image", default="").endswith("\\cmd.exe"),
                ]
            ),
            "MsiExec.exe" in event.deep_get("ParentCommandLine", default=""),
            "-Embedding " in event.deep_get("ParentCommandLine", default=""),
            not any(
                [
                    all(
                        [
                            event.deep_get("Image", default="").endswith(
                                ":\\Windows\\System32\\cmd.exe"
                            ),
                            "C:\\Program Files\\SplunkUniversalForwarder\\bin\\"
                            in event.deep_get("CommandLine", default=""),
                        ]
                    ),
                    any(
                        [
                            "\\DismFoDInstall.cmd" in event.deep_get("CommandLine", default=""),
                            all(
                                [
                                    "\\MsiExec.exe -Embedding "
                                    in event.deep_get("ParentCommandLine", default=""),
                                    "Global\\MSI0000"
                                    in event.deep_get("ParentCommandLine", default=""),
                                ]
                            ),
                        ]
                    ),
                ]
            ),
        ]
    ):
        return True
    return False
