How can I pass multiple arguments to Set-AzureRmVMCustomScriptExtension?

后端 未结 2 1692
旧时难觅i
旧时难觅i 2021-01-21 16:54

The Azure Cmdlet for adding a Custom Script Extension to a VM named Set-AzureRmVMCustomScriptExtension has an -Argument switch, which states that it accepts a strin

2条回答
  •  遥遥无期
    2021-01-21 17:15

    There is an example of multiple arguments in use from this blog:

    Set-AzureVMCustomScriptExtension -VM $x -ContainerName 'test' -FileName 'script1.ps1','script2.ps1','script3.ps1' -Run 'script1.ps1' -Argument 'arg1 arg2' 
          | Update-AzureVM  
    

    If this code snipett actually works then it means you need to pass a space delimited string for your arguments. Just make sure you keep your double quotes so the variables expand properly.

提交回复
热议问题