def rule(event):
    if any(
        [
            all(
                [
                    any(
                        [
                            any(
                                [
                                    event.deep_get("Image", default="").endswith(
                                        "\\powershell.exe"
                                    ),
                                    event.deep_get("Image", default="").endswith("\\pwsh.exe"),
                                ]
                            ),
                            event.deep_get("OriginalFileName", default="")
                            in ["PowerShell.EXE", "pwsh.dll"],
                        ]
                    ),
                    any(
                        [
                            "-DisableBehaviorMonitoring $true"
                            in event.deep_get("CommandLine", default=""),
                            "-DisableRuntimeMonitoring $true"
                            in event.deep_get("CommandLine", default=""),
                        ]
                    ),
                ]
            ),
            all(
                [
                    any(
                        [
                            event.deep_get("Image", default="").endswith("\\sc.exe"),
                            event.deep_get("OriginalFileName", default="") == "sc.exe",
                        ]
                    ),
                    any(
                        [
                            all(
                                [
                                    "stop" in event.deep_get("CommandLine", default=""),
                                    "WinDefend" in event.deep_get("CommandLine", default=""),
                                ]
                            ),
                            all(
                                [
                                    "delete" in event.deep_get("CommandLine", default=""),
                                    "WinDefend" in event.deep_get("CommandLine", default=""),
                                ]
                            ),
                            all(
                                [
                                    "config" in event.deep_get("CommandLine", default=""),
                                    "WinDefend" in event.deep_get("CommandLine", default=""),
                                    "start=disabled" in event.deep_get("CommandLine", default=""),
                                ]
                            ),
                        ]
                    ),
                ]
            ),
        ]
    ):
        return True
    return False
