Pass Powershell switch to an Azure Resource Manager Template (ARM)

你离开我真会死。 提交于 2019-12-11 04:52:57

问题


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:


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


来源:https://stackoverflow.com/questions/50716482/pass-powershell-switch-to-an-azure-resource-manager-template-arm

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!