def rule(event):
    if all(
        [
            "new-object" in event.deep_get("CommandLine", default=""),
            "text.encoding]::ascii" in event.deep_get("CommandLine", default=""),
            any(
                [
                    "system.io.compression.deflatestream"
                    in event.deep_get("CommandLine", default=""),
                    "system.io.streamreader" in event.deep_get("CommandLine", default=""),
                    "readtoend(" in event.deep_get("CommandLine", default=""),
                ]
            ),
        ]
    ):
        return True
    return False
