def rule(event):
    if all(
        [
            any(
                [
                    event.deep_get("Image", default="").endswith("\\schtasks.exe"),
                    event.deep_get("OriginalFileName", default="") == "schtasks.exe",
                ]
            ),
            "/Create" in event.deep_get("CommandLine", default=""),
            any(
                [
                    "Get-ItemProperty" in event.deep_get("CommandLine", default=""),
                    " gp " in event.deep_get("CommandLine", default=""),
                ]
            ),
            any(
                [
                    "HKCU:" in event.deep_get("CommandLine", default=""),
                    "HKLM:" in event.deep_get("CommandLine", default=""),
                    "registry::" in event.deep_get("CommandLine", default=""),
                    "HKEY_" in event.deep_get("CommandLine", default=""),
                ]
            ),
            not any(
                [
                    "FromBase64String" in event.deep_get("CommandLine", default=""),
                    "encodedcommand" in event.deep_get("CommandLine", default=""),
                ]
            ),
        ]
    ):
        return True
    return False
