def rule(event):
    if all(
        [
            "C:\\Program Files\\WindowsApps\\" in event.deep_get("ParentImage", default=""),
            any(
                [
                    any(
                        [
                            event.deep_get("Image", default="").endswith("\\cmd.exe"),
                            event.deep_get("Image", default="").endswith("\\cscript.exe"),
                            event.deep_get("Image", default="").endswith("\\mshta.exe"),
                            event.deep_get("Image", default="").endswith("\\powershell.exe"),
                            event.deep_get("Image", default="").endswith("\\powershell_ise.exe"),
                            event.deep_get("Image", default="").endswith("\\pwsh.exe"),
                            event.deep_get("Image", default="").endswith("\\regsvr32.exe"),
                            event.deep_get("Image", default="").endswith("\\rundll32.exe"),
                            event.deep_get("Image", default="").endswith("\\wscript.exe"),
                        ]
                    ),
                    any(
                        [
                            "cmd /c" in event.deep_get("CommandLine", default=""),
                            "Invoke-" in event.deep_get("CommandLine", default=""),
                            "Base64" in event.deep_get("CommandLine", default=""),
                        ]
                    ),
                ]
            ),
            not any(
                [
                    all(
                        [
                            ":\\Program Files\\WindowsApps\\Microsoft.WindowsTerminal"
                            in event.deep_get("ParentImage", default=""),
                            event.deep_get("ParentImage", default="").endswith(
                                "\\WindowsTerminal.exe"
                            ),
                            any(
                                [
                                    event.deep_get("Image", default="").endswith(
                                        "\\powershell.exe"
                                    ),
                                    event.deep_get("Image", default="").endswith("\\cmd.exe"),
                                    event.deep_get("Image", default="").endswith("\\pwsh.exe"),
                                ]
                            ),
                        ]
                    ),
                    all(
                        [
                            event.deep_get("ParentImage", default="").startswith(
                                "C:\\Program Files\\WindowsApps\\Microsoft.SysinternalsSuite"
                            ),
                            event.deep_get("Image", default="").endswith("\\cmd.exe"),
                        ]
                    ),
                ]
            ),
        ]
    ):
        return True
    return False
