def rule(event):
    if all(
        [
            any(
                [
                    any(
                        [
                            event.deep_get("Image", default="").endswith("\\powershell_ise.exe"),
                            event.deep_get("Image", default="").endswith("\\powershell.exe"),
                            event.deep_get("Image", default="").endswith("\\pwsh.exe"),
                        ]
                    ),
                    event.deep_get("OriginalFileName", default="")
                    in ["powershell_ise.EXE", "PowerShell.EXE", "pwsh.dll"],
                ]
            ),
            any(
                [
                    "curl " in event.deep_get("CommandLine", default=""),
                    "Invoke-RestMethod" in event.deep_get("CommandLine", default=""),
                    "Invoke-WebRequest" in event.deep_get("CommandLine", default=""),
                    " irm " in event.deep_get("CommandLine", default=""),
                    "iwr " in event.deep_get("CommandLine", default=""),
                    "wget " in event.deep_get("CommandLine", default=""),
                ]
            ),
            any(
                [
                    "://1" in event.deep_get("CommandLine", default=""),
                    "://2" in event.deep_get("CommandLine", default=""),
                    "://3" in event.deep_get("CommandLine", default=""),
                    "://4" in event.deep_get("CommandLine", default=""),
                    "://5" in event.deep_get("CommandLine", default=""),
                    "://6" in event.deep_get("CommandLine", default=""),
                    "://7" in event.deep_get("CommandLine", default=""),
                    "://8" in event.deep_get("CommandLine", default=""),
                    "://9" in event.deep_get("CommandLine", default=""),
                ]
            ),
        ]
    ):
        return True
    return False
