def rule(event):
    if all(
        [
            "winrm" in event.deep_get("CommandLine", default=""),
            any(
                [
                    "format:pretty" in event.deep_get("CommandLine", default=""),
                    'format:"pretty"' in event.deep_get("CommandLine", default=""),
                    'format:"text"' in event.deep_get("CommandLine", default=""),
                    "format:text" in event.deep_get("CommandLine", default=""),
                ]
            ),
            not any(
                [
                    event.deep_get("Image", default="").startswith("C:\\Windows\\System32\\"),
                    event.deep_get("Image", default="").startswith("C:\\Windows\\SysWOW64\\"),
                ]
            ),
        ]
    ):
        return True
    return False
