import re


def rule(event):
    if all(
        [
            event.deep_get("ParentImage", default="").endswith("\\powershell.exe"),
            "-ExecutionPolicy Bypass -WindowStyle Hidden -E JAB"
            in event.deep_get("ParentCommandLine", default=""),
            re.match(
                r"^.*--load-extension=\".*\\Appdata\\local\\chrome\".*$",
                event.deep_get("CommandLine", default=""),
            ),
            event.deep_get("Image", default="").endswith("\\chrome.exe"),
        ]
    ):
        return True
    return False
