Pass Powershell switch to an Azure Resource Manage

2019-08-09 03:52发布

How can I directly pass a powershell switch (System.Management.Automation.SwitchParameter) to an ARM template (which will be used as a condition in the template itself)?

Currently I am using the workaround of converting the switch to an string.

1条回答
Luminary・发光体
2楼-- · 2019-08-09 04:02

Lets say your switch is called fullversion:

param(
...
[switch]$fullversion
)

and your parameterfile also contains a parameter called fullversion then you can pass it like:

New-AzureRmResourceGroupDeployment -fullversion $fullversion.IsPresent
查看更多
登录 后发表回答