def rule(event):
    if all(
        [
            event.deep_get("Image", default="").endswith("\\powershell.exe"),
            "http://127.0.0.1" in event.deep_get("CommandLine", default=""),
            "%{(IRM $_)}" in event.deep_get("CommandLine", default=""),
            "Invoke" in event.deep_get("CommandLine", default=""),
        ]
    ):
        return True
    return False
