Microsoft用于安装Azure扩展的示例始终给出错误期望属性名称用双引号引起来:第1行第2列字符1

问题描述

az vm extension set \

-资源组QuickstartAnsible-rg
--vm-name QuickstartAnsible-vm
--name customScript
--publisher Microsoft.Azure.Extensions
--version 2.1
--settings'{“ fileUris”:[“ https://raw.githubusercontent.com/MicrosoftDocs/mslearn-ansible-control-machine/master/configure-ansible-centos.sh”]}''
--protected-settings'{“ commandToExecute”:“ ./configure-ansible-centos.sh”}'

解决方法

当它在PowerShell ISE上运行时,我可以重现此错误,但是它可以在WSL的Bash环境中工作。

在PowerShell上,您可以像这样在双引号中加上代码。

az vm extension set --resource-group "nancytest" --vm-name "ubun-a" --name "customScript" --publisher "Microsoft.Azure.Extensions" --version 2.1 --settings "{'fileUris':['https://raw.githubusercontent.com/MicrosoftDocs/mslearn-ansible-control-machine/master/configure-ansible-centos.sh']}" --protected-settings "{'commandToExecute':'./configure-ansible-centos.sh'}"

在PowerShell上 enter image description here

重击 enter image description here

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...