def rule(event):
    if all(
        [
            any(
                [
                    "powershell.exe" in event.deep_get("CommandLine", default=""),
                    "\\powershell" in event.deep_get("CommandLine", default=""),
                    "\\pwsh" in event.deep_get("CommandLine", default=""),
                    "pwsh.exe" in event.deep_get("CommandLine", default=""),
                ]
            ),
            "/c " in event.deep_get("CommandLine", default=""),
            "\\AppData\\" in event.deep_get("CommandLine", default=""),
            any(
                [
                    "Local\\" in event.deep_get("CommandLine", default=""),
                    "Roaming\\" in event.deep_get("CommandLine", default=""),
                ]
            ),
        ]
    ):
        return True
    return False
