Az PowerShell 是一组 cmdlet,可直接从 PowerShell 管理 Azure 资源。Az PowerShell 旨易于学习和入门,提供强大的功能并用于自动化。
- 查看
PS C:\WINDOWS\system32> $PSVersionTable.PSVersion
Major Minor Build Revision
----- ----- ----- --------
5 1 19041 2364
PS C:\WINDOWS\system32> Get-Module azure*
PS C:\WINDOWS\system32> Install-Module -Name Az -Repository PSGallery
需要使用 NuGet 提供程序来继续操作
PowerShellGet 需要使用 NuGet 提供程序“2.8.5.201”或更高版本来与基于 NuGet 的存储库交互。必须在“C:\Program
Files\PackageManagement\ProviderAssemblies”或“C:\Users\jiahe\AppData\Local\PackageManagement\ProviderAssemblies”中提
供 NuGet 提供程序。也可以通过运行 'Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force' 安装 NuGet
提供程序。是否要让 PowerShellGet 立即安装并导入 NuGet 提供程序?
[Y] 是(Y) [N] 否(N) [S] 暂停(S) [?] 帮助 (默认值为“Y”): Y
不受信任的存储库
你正在从不受信任的存储库安装模块。如果你信任该存储库,请通过运行 Set-PSRepository cmdlet 更改其 InstallationPolicy
值。是否确实要从“PSGallery”安装模块?
[Y] 是(Y) [A] 全是(A) [N] 否(N) [L] 全否(L) [S] 暂停(S) [?] 帮助 (默认值为“N”): A
PS C:\WINDOWS\system32> Get-Module -ListAvailable
目录: C:\Program Files\WindowsPowerShell\Modules
ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Script 2.12.1 Az.Accounts {Disable-AzDataCollection, Disable-AzContextAutosave, Enab...
Script 2.0.0 Az.Advisor {Disable-AzAdvisorRecommendation, Enable-AzAdvisorRecommen...
Script 5.3.1 Az.Aks {Get-AzAksCluster, New-AzAksCluster, Remove-AzAksCluster, ...
Script 1.1.4 Az.AnalysisServices {Resume-AzAnalysisServicesServer, Suspend-AzAnalysisServic...
Script 4.0.2 Az.ApiManagement {Add-AzApiManagementApiToGateway, Add-AzApiManagementApiTo...
Script 1.2.0 Az.AppConfiguration {Get-AzAppConfigurationStore, Get-AzAppConfigurationStoreK...
Script 2.2.2 Az.ApplicationInsights {Get-AzApplicationInsights, Get-AzApplicationInsightsApiKe...
Script 2.0.0 Az.Attestation {Get-AzAttestationPolicy, Set-AzAttestationPolicy, Reset-A...
Script 1.0.0 Az.Automanage {Get-AzAutomanageBestPractice, Get-AzAutomanageConfigProfi...
Script 1.9.1 Az.Automation {Set-AzAutomationPython3Package, New-AzAutomationPython3Pa...