def rule(event):
    if all(
        [
            any(
                [
                    "\\ShellIds\\Microsoft.PowerShell\\ExecutionPolicy"
                    in event.deep_get("CommandLine", default=""),
                    "\\Policies\\Microsoft\\Windows\\PowerShell\\ExecutionPolicy"
                    in event.deep_get("CommandLine", default=""),
                ]
            ),
            any(
                [
                    "Bypass" in event.deep_get("CommandLine", default=""),
                    "RemoteSigned" in event.deep_get("CommandLine", default=""),
                    "Unrestricted" in event.deep_get("CommandLine", default=""),
                ]
            ),
        ]
    ):
        return True
    return False
