在macOS上安裝 Azure PowerShell
本文說明如何從 macOS 上的 PowerShell 資源庫 安裝 Az PowerShell 模組。
Az PowerShell 模組是匯總模組。 安裝它會下載一般可用的 Az PowerShell 模組,並讓其 Cmdlet 可供使用。
先決條件
安裝
開啟終端機或其他 Shell 主機應用程式,然後執行 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。