簡體   English   中英

運行命令腳本無法識別術語“az”

[英]The term 'az' is not recognized from Run Command Script

我嘗試使用運行命令腳本運行將在 VM 上執行的“az 版本”的簡單命令,但出現此錯誤: The term 'az' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. The term 'az' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

但是,當我從 VM 運行此命令時,我將它與遠程桌面連接連接起來,它可以工作,並且我獲得了包含所有詳細信息的“az 版本”。 我還在 VM 中安裝了 AZ 模塊。

我應該怎么做才能從運行命令腳本中操作“az”命令?

術語“az”不被識別為 cmdlet、函數、腳本文件或可運行程序的名稱。 檢查名稱的拼寫,或者如果包含路徑,請驗證路徑是否正確,然后重試。

根據錯誤消息,您似乎沒有安裝az module來運行az version cmdlet。

我應該怎么做才能從運行命令腳本中操作“az”命令?

需要安裝 Azure CLI 才能從門戶的運行命令腳本運行 az cmdlet。

您可以使用以下 cmdlet 將AzureCLI安裝在帶有預安裝 Az 模塊的 Windows 機器上。

$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest -Uri https://aka.ms/installazurecliwindows -OutFile .\AzureCLI.msi; Start-Process msiexec.exe -Wait -ArgumentList '/I AzureCLI.msi /quiet'; rm .\AzureCLI.msi

安裝 Azure CLI 后,您可以運行 Az 版本 cmdlet 來檢查 Az cli 版本。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM