def rule(event):
    if all(
        [
            any(
                [
                    "Invoke-WebRequest" in event.deep_get("ScriptBlockText", default=""),
                    "Invoke-RestMethod" in event.deep_get("ScriptBlockText", default=""),
                    " irm " in event.deep_get("ScriptBlockText", default=""),
                    "iwr " in event.deep_get("ScriptBlockText", default=""),
                ]
            ),
            "-UserAgent " in event.deep_get("ScriptBlockText", default=""),
        ]
    ):
        return True
    return False
