def rule(event):
    if all(
        [
            any(
                [
                    event.deep_get("ParentImage", default="").endswith("\\powershell.exe"),
                    event.deep_get("ParentImage", default="").endswith("\\pwsh.exe"),
                ]
            ),
            event.deep_get("Image", default="").endswith("\\schtasks.exe"),
            "/Create" in event.deep_get("CommandLine", default=""),
            "powershell.exe -NonI" in event.deep_get("CommandLine", default=""),
            "/TN Updater /TR" in event.deep_get("CommandLine", default=""),
            any(
                [
                    "/SC ONLOGON" in event.deep_get("CommandLine", default=""),
                    "/SC DAILY /ST" in event.deep_get("CommandLine", default=""),
                    "/SC ONIDLE" in event.deep_get("CommandLine", default=""),
                    "/SC HOURLY" in event.deep_get("CommandLine", default=""),
                ]
            ),
        ]
    ):
        return True
    return False
