import re


def rule(event):
    if all(
        [
            "Get-ADComputer " in event.deep_get("ScriptBlockText", default=""),
            re.match(r"^.* -Filter \\.*.*$", event.deep_get("ScriptBlockText", default="")),
            any(
                [
                    " | Select " in event.deep_get("ScriptBlockText", default=""),
                    "Out-File" in event.deep_get("ScriptBlockText", default=""),
                    "Set-Content" in event.deep_get("ScriptBlockText", default=""),
                    "Add-Content" in event.deep_get("ScriptBlockText", default=""),
                ]
            ),
        ]
    ):
        return True
    return False
