def rule(event):
    if all(
        [
            any(
                [
                    event.deep_get("SourceImage", default="").endswith("\\powershell.exe"),
                    event.deep_get("SourceImage", default="").endswith("\\pwsh.exe"),
                ]
            ),
            not event.deep_get("SourceParentImage", default="").endswith(
                ":\\Windows\\System32\\CompatTelRunner.exe"
            ),
        ]
    ):
        return True
    return False
