- 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?
推薦閱讀
- What's New in TensorFlow 2.0
- Learning Real-time Processing with Spark Streaming
- Power Up Your PowToon Studio Project
- 小程序,巧運營:微信小程序運營招式大全
- The Data Visualization Workshop
- Spring Boot進階:原理、實戰與面試題分析
- 響應式Web設計:HTML5和CSS3實戰(第2版)
- Scratch趣味編程:陪孩子像搭積木一樣學編程
- Android Development Tools for Eclipse
- Kotlin Programming By Example
- Python數據可視化之美:專業圖表繪制指南(全彩)
- JavaScript前端開發基礎教程
- Node.js應用開發
- Backbone.js Patterns and Best Practices
- Unreal Engine Game Development Cookbook