官术网_书友最值得收藏!

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:

  1. Enter the following command to check for installed PowerShell modules:
      Get-PSRepository  
  1. Install the AzureRM module:
      Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201
-Force
  1. Verify the installation status:
      Get-Command -Module AzureRM.AzureStackAdmin  
  1. 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?

主站蜘蛛池模板: 监利县| 化州市| 措勤县| 隆子县| 长子县| 建湖县| 开原市| 滕州市| 江津市| 霞浦县| 获嘉县| 长宁区| 新巴尔虎右旗| 永川市| 综艺| 江永县| 鲜城| 平舆县| 莫力| 鹿泉市| 大安市| 永德县| 临澧县| 襄城县| 鄢陵县| 泰州市| 苏尼特右旗| 青岛市| 大邑县| 法库县| 堆龙德庆县| 峨眉山市| 沂水县| 金川县| 务川| 兴宁市| 米林县| 广汉市| 扎囊县| 上犹县| 新泰市|