本文說明如何從 macOS 上的 PowerShell 資源庫 安裝 Az PowerShell 模組。
Az PowerShell 模組為彙總模組。 安裝它會下載正式發行的 Az PowerShell 模組,並使其 Cmdlet 可供使用。
先決條件
- 安裝支援的 PowerShell 第 7 版或更新版本
安裝
開啟終端機或其他殼層主機應用程式,然後執行 pwsh 以啟動 PowerShell。
使用 Install-Module Cmdlet 來安裝 Az PowerShell 模組:
Install-Module -Name Az -Repository PSGallery -Force
更新 Azure PowerShell 模組
使用 Update-Module Cmdlet 更新至最新版本的 Az PowerShell 模組。
Update-Module -Name Az -Force
更新 Update-Module Az PowerShell 模組並不會從系統中移除舊版的 Az PowerShell 模組。
解除安裝
若要從系統移除 Az PowerShell 模組,請參閱解除 安裝 Azure PowerShell 模組。
登錄
若要開始使用 Az PowerShell 模組管理 Azure 資源,請啟動 PowerShell 工作階段並執行 Connect-AzAccount 以登入 Azure:
Connect-AzAccount
使用您的 Azure 帳戶登入認證來登入隨即開啟的瀏覽器視窗。
您必須針對啟動的每個新 PowerShell 會話重複此步驟。 若要瞭解如何在 PowerShell 工作階段之間保存 Azure 登入,請參閱 Azure PowerShell 內容物件。
故障排除
如需 Az PowerShell 模組常見安裝問題的解決方案,請參閱 針對 Az PowerShell 模組的安裝問題進行疑難排解。
提供意見反應
若要提出有關 Az PowerShell 模組的問題,請參閱在 GitHub 上提出問題。 若要從 PowerShell 會話內提供意見反應,請使用 Send-Feedback Cmdlet。
後續步驟
若要深入瞭解如何使用 Az PowerShell 模組管理 Azure 資源,請參閱 開始使用 Azure PowerShell。