- Building Hybrid Clouds with Azure Stack
- Markus Klein Susan Roesner
- 154字
- 2021-07-02 19:36:04
PowerShell commandlets
The second way to communicate with Azure Stack is PowerShell. With the wide range of PowerShell commandlets (cmdlets), everything is possible. From the administration point of view, it is always the better choice to use PowerShell, because it is reusable and redoable, and each script is a documentation itself.
The steps to enable PowerShell are as follows:
- Enter the following command to check for installed PowerShell modules:
Get-PSRepository

- Install the AzureRM module:
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201
-Force

- Verify the installation status:
Get-Command -Module AzureRM.AzureStackAdmin
- Now you can start over with AzureRM PowerShell commands. Connecting to Azure Stack using PowerShell should look like this:
$AADUserName='YourAADAccount@Yourdomain' $AADPassword='YourAADPassword'|ConvertTo-SecureString -Force
-AsPlainText $AADCredential=New-Object PSCredential($AADUserName,$AADPassword) $AADTenantID = "YourAADDomain" Add-AzureRmEnvironment -Name "Azure Stack" ` -ActiveDirectoryEndpoint
("https://login.windows.net/$AADTenantID/") ` -ActiveDirectoryServiceEndpointResourceId
"https://azurestack.local-api/" ` -ResourceManagerEndpoint ("https://api.azurestack.local/") ` -GalleryEndpoint ("https://gallery.azurestack.local:30016/") ` -GraphEndpoint "https://graph.windows.net/" $env = Get-AzureRmEnvironment 'Azure Stack' Add-AzureRmAccount -Environment $env -Credential $AADCredential
- Verbose Get-AzureRmSubscription -SubscriptionName "youroffer" |
Select-AzureRmSubscription Get-AzureRmResource
Simple, isn't it?
推薦閱讀
- 深入核心的敏捷開發:ThoughtWorks五大關鍵實踐
- Learning Apex Programming
- 深入淺出Electron:原理、工程與實踐
- JavaScript 網頁編程從入門到精通 (清華社"視頻大講堂"大系·網絡開發視頻大講堂)
- 編寫高質量代碼:改善Python程序的91個建議
- Scratch 3游戲與人工智能編程完全自學教程
- Web全棧工程師的自我修養
- Building Minecraft Server Modifications
- Visual C#.NET程序設計
- Mathematica Data Analysis
- Learning SciPy for Numerical and Scientific Computing(Second Edition)
- 青少年信息學競賽
- Python算法詳解
- 一塊面包板玩轉Arduino編程
- ExtJS Web應用程序開發指南第2版