- 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?
推薦閱讀
- 手機(jī)安全和可信應(yīng)用開發(fā)指南:TrustZone與OP-TEE技術(shù)詳解
- Learn to Create WordPress Themes by Building 5 Projects
- Java高并發(fā)核心編程(卷2):多線程、鎖、JMM、JUC、高并發(fā)設(shè)計(jì)模式
- JavaScript前端開發(fā)與實(shí)例教程(微課視頻版)
- The Computer Vision Workshop
- Internet of Things with Intel Galileo
- QGIS:Becoming a GIS Power User
- JavaScript 程序設(shè)計(jì)案例教程
- Learning OpenStack Networking(Neutron)
- Swift 4 Protocol-Oriented Programming(Third Edition)
- Mastering ArcGIS Enterprise Administration
- Python網(wǎng)絡(luò)爬蟲技術(shù)與應(yīng)用
- ASP.NET 4.0 Web程序設(shè)計(jì)
- Hands-On Dependency Injection in Go
- Python無監(jiān)督學(xué)習(xí)