{
  "name": "Check Windows Defender Status",
  "hosts": ["local", "remote"],
  "functions": {
    "run": {
      "command": "Get-MpComputerStatus",
      "method": "cimsession",
      "json": true,
      "result": {
        "array": [
          {
          "label": {"static": "Antivirus"},
            "followups": [
              {
                "function": "enable_antivirus",
                "data": {
                  "state": {"bool": "AntivirusEnabled", "inverse": true}
                },
                "enabled": {"bool": "AntivirusEnabled"}
              }
            ]
          },
          {
            "label": {"static": "Antispyware"},
              "followups": [
                {
                  "function": "enable_antispyware",
                  "data": {
                    "state": {"bool": "AntispywareEnabled", "inverse": true}
                  },
                  "enabled": {"bool": "AntispywareEnabled"}
                }
              ]
            }
        ] 
      } 
    },
    "enable_antivirus": {
      "name": "Enable Antivirus",
      "command": "",
      "role": "elevated",
      "result": {
        "label": {"static": "TODO: set Antivirus state"}
      }
    },
    "enable_antispyware": {
      "name": "Enable Antispyware",
      "command": "",
      "role": "elevated",
      "result": {
        "label": {"static": "TODO: set Antispyware state"}
      }
    }
  }
}