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"],
                ]
            ),
            "-ComObject" in event.deep_get("CommandLine", default=""),
            "InstallProduct(" in event.deep_get("CommandLine", default=""),
            any(
                [
                    "http" in event.deep_get("CommandLine", default=""),
                    "\\\\" in event.deep_get("CommandLine", default=""),
                ]
            ),
            not any(
                [
                    "://127.0.0.1" in event.deep_get("CommandLine", default=""),
                    "://localhost" in event.deep_get("CommandLine", default=""),
                ]
            ),
        ]
    ):
        return True
    return False
