将哈希表作为参数从PowerShell传递到ARM模板

问题描述 投票:1回答:1

我想替换我的参数文件,并仅使用powershell给出参数。我的参数文件如下所示:

{
  "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
  "contentVersion": "1.0.0.0",
  "parameters": {
    "subnets": {
      "value": {
        "settings": [
          {
            "name": "firstSubnet",
            "addressPrefix": "10.0.0.0/24"
          },
          {
            "name": "secondSubnet",
            "addressPrefix": "10.0.1.0/24"
          }
        ]
      }
    }
  }
}

我尝试使用:

-subnets {"settings":[{"name": "firstSubnet","addressPrefix": "10.0.0.0/24"},{"name": "secondSubnet","addressPrefix": "10.0.1.0/24"]}}

但是我一直在出错。使用哈希表作为参数的正确语法是什么?

我想替换我的参数文件,并仅使用powershell给出参数。我的参数文件如下所示:{“ $ schema”:“ https://schema.management.azure.com/schemas/2015-01-01 / ...

azure powershell arm-template
1个回答
1
投票

您的示例不是哈希表。这只是一个未引用的JSON字符串。

© www.soinside.com 2019 - 2024. All rights reserved.