我正在使用PowerShell中的Azure CLI 2.0来管理存储账户。我拥有一个SAS令牌(我将其存储在变量中),并且希望在命令中使用它。以下是我正在运行的脚本:
当我运行这个程序时,出现了以下错误:
$sasToken = 'st=2017-11-13T10%3A55%3A06Z&se=2017-11-13T11%3A27%3A06Z&sp=w&spr=https&sv=2017-04-17&sr=c&sig=%2BA6LDTwHes6JdxEAHXSvbYc70y30OcznjMVSyFbCXog%3D'
az storage blob upload `
--account-name mystorageaccount `
--container-name mycontainer `
--file c:\temp\file.txt `
--name file.txt `
--sas-token $sasToken
当我运行这个程序时,出现了以下错误:
The specified resource does not exist.
'se' is not recognized as an internal or external command,
operable program or batch file.
'sp' is not recognized as an internal or external command,
operable program or batch file.
'spr' is not recognized as an internal or external command,
operable program or batch file.
'sv' is not recognized as an internal or external command,
operable program or batch file.
'sr' is not recognized as an internal or external command,
operable program or batch file.
'sig' is not recognized as an internal or external command,
operable program or batch file.
我看到 PowerShell 在每次遇到 & 符号时都会截断 SAS token,而 Azure CLI 没有将其视为同一字符串的一部分。
有没有办法强制 PowerShell 将 SAS token 作为完整字符串调用 Azure CLI?