def rule(event):
    if all(
        [
            any(
                [
                    any(
                        [
                            event.deep_get("Image", default="").endswith("\\powershell.exe"),
                            event.deep_get("Image", default="").endswith("\\pwsh.exe"),
                            event.deep_get("Image", default="").endswith("\\powershell_ise.exe"),
                        ]
                    ),
                    event.deep_get("OriginalFileName", default="")
                    in ["PowerShell.EXE", "pwsh.dll"],
                ]
            ),
            "Set-NetFirewallProfile " in event.deep_get("CommandLine", default=""),
            " -Enabled " in event.deep_get("CommandLine", default=""),
            " False" in event.deep_get("CommandLine", default=""),
            any(
                [
                    " -All " in event.deep_get("CommandLine", default=""),
                    "Public" in event.deep_get("CommandLine", default=""),
                    "Domain" in event.deep_get("CommandLine", default=""),
                    "Private" in event.deep_get("CommandLine", default=""),
                ]
            ),
        ]
    ):
        return True
    return False
