def rule(event):
    if all(
        [
            any(
                [
                    any(
                        [
                            event.deep_get("Image", default="").endswith("\\powershell.exe"),
                            event.deep_get("Image", default="").endswith("\\pwsh.exe"),
                        ]
                    ),
                    event.deep_get("OriginalFileName", default="")
                    in ["PowerShell.EXE", "pwsh.dll"],
                ]
            ),
            any(
                [
                    "hctac" in event.deep_get("CommandLine", default=""),
                    "kaerb" in event.deep_get("CommandLine", default=""),
                    "dnammoc" in event.deep_get("CommandLine", default=""),
                    "ekovn" in event.deep_get("CommandLine", default=""),
                    "eliFd" in event.deep_get("CommandLine", default=""),
                    "rahc" in event.deep_get("CommandLine", default=""),
                    "etirw" in event.deep_get("CommandLine", default=""),
                    "golon" in event.deep_get("CommandLine", default=""),
                    "tninon" in event.deep_get("CommandLine", default=""),
                    "eddih" in event.deep_get("CommandLine", default=""),
                    "tpircS" in event.deep_get("CommandLine", default=""),
                    "ssecorp" in event.deep_get("CommandLine", default=""),
                    "llehsrewop" in event.deep_get("CommandLine", default=""),
                    "esnopser" in event.deep_get("CommandLine", default=""),
                    "daolnwod" in event.deep_get("CommandLine", default=""),
                    "tneilCbeW" in event.deep_get("CommandLine", default=""),
                    "tneilc" in event.deep_get("CommandLine", default=""),
                    "ptth" in event.deep_get("CommandLine", default=""),
                    "elifotevas" in event.deep_get("CommandLine", default=""),
                    "46esab" in event.deep_get("CommandLine", default=""),
                    "htaPpmeTteG" in event.deep_get("CommandLine", default=""),
                    "tcejbO" in event.deep_get("CommandLine", default=""),
                    "maerts" in event.deep_get("CommandLine", default=""),
                    "hcaerof" in event.deep_get("CommandLine", default=""),
                    "retupmoc" in event.deep_get("CommandLine", default=""),
                ]
            ),
            not any(
                [
                    " -EncodedCommand " in event.deep_get("CommandLine", default=""),
                    " -enc " in event.deep_get("CommandLine", default=""),
                ]
            ),
        ]
    ):
        return True
    return False
