def rule(event):
    if all(
        [
            "\\Services\\" in event.deep_get("TargetObject", default=""),
            event.deep_get("TargetObject", default="").endswith("\\ImagePath"),
            any(
                [
                    "powershell" in event.deep_get("Details", default=""),
                    "pwsh" in event.deep_get("Details", default=""),
                ]
            ),
        ]
    ):
        return True
    return False
