PSArm icon indicating copy to clipboard operation
PSArm copied to clipboard

ARM keys/keywords that conflict with PowerShell keywords need a solution

Open rjmholt opened this issue 3 years ago • 0 comments

For example:

        "mode": "All",
        "policyRule": {
          "if": {
            "allOf": [
              {
                "field": "type",
                "equals": "..."
              },
              {
                "anyOf": [
                  {
                    "field": "location",
                    "notEquals": "..."
                  },
                  {
                    "field": "name",
                    "notEquals": "..."
                  }
                ]
              }
            ]
          },
          "then": {
            "effect": "audit"
          }

Generates a call like:

if {
  ...
}
then {
  ...
}

Some solutions:

  • Add a & operator
  • Add a keyword prefix for these commands
  • Find a new construct for these conditionals

rjmholt avatar Mar 30 '21 18:03 rjmholt