2015/10/12 (現地時間) に Azure PowerShell 1.0 Preview が公開されました。
従来の Azure PowerShell では、Azure モジュールの中で Azure サービス管理関連のコマンドレットと Azure リソース マネージャー関連のコマンドレットの切替え (Switch-AzureMode) が必要でしたが、Azure PowerShell 1.0 から Azure リソース マネージャー関連のコマンドレットは AzureRM モジュールとして纏められました。
Azure PowerShell 1.0 Preview は、以下のどちらかの環境が必要となります。
- Windows 10
- Windows Management Framework 5.0
 ※インストールには、Microsoft .NET Framework 4.5 が必要、要再起動
記事公開時点で Preview 版のため、今後仕様の変更がある可能性がありますが、新しい Azure PowerShell コマンドレットの一覧について、MSDN のサイトに公開されています。
- Azure Resource Manager Cmdlets
 https://msdn.microsoft.com/en-us/library/mt125356.aspx
- Azure Service Management Cmdlets
 https://msdn.microsoft.com/en-us/library/dn708504.aspx
[Azure PowerShell 1.0 Preview のインストール手順]
※Azure PowerShell 1.0 Preview をインストールする場合、既にインストールされている Azure PowerShell をアンインストールする必要があります。
- Windows PowerShell を管理者権限で実行します。
- 以下のコマンドを実行し、実行ポリシーの確認、RemoteSigned に変更します。
Get-ExecutionPolicy Set-ExecutionPolicy RemoteSigned 
- 以下のコマンドを実行し、Azure PowerShell 1.0 Preview (AzureRM モジュール) をダウンロード、インストールします。
Install-Module AzureRM 
- 以下のコマンドを実行し、モジュールをインストールします。
Install-AzureRM 
- 以下のコマンドを実行し、モジュールをインポートします。
Import-AzureRM 
- 以下のコマンドを実行、Azure PowerShell 1.0 Preview (Azure モジュール) をダウンロード、インストールします。
Install-Module Azure 
- 以下のコマンドを実行、Azure PowerShell 1.0 Preview (Azure モジュール) をインポートします。
Import-Module Azure 
- 以下のコマンドを実行し、モジュールがインポートされていることを確認します。
Get-Module 
[Azure PowerShell 1.0 Preview のアンインストール手順]
- Windows PowerShell を管理者権限で実行します。
- 以下のコマンドを実行し、Azure PowerShell 1.0 Preview (AzureRM モジュール) をアンインストールします。
- 以下のコマンドを実行し、Azure PowerShell 1.0 Preview (AzureRM モジュール) をアンインストールします。
Uninstall-Module Azure 
Uninstall-AzureRM Uninstall-Module AzureRM
[Tips]
Azure リソース マネージャー モードでサインインするときは以下のコマンドレットを実行し、ユーザーIDとパスワードを入力、サインインします。
Login-AzureRmAccount
サインインした後、サブスクリプション一覧を表示するには、以下のコマンドレットを実行します。
Get-AzureRmSubscription -All
テナント (Azure サービス管理でいうところのディレクトリ)、サブスクリプションを切り替えるには、以下のコマンドレットを実行します。
Select-AzureRmSubscription -TenantId "<テナント ID>" -SubscriptionId "<サブスクリプション ID>"
リソース プロバイダーを一覧表示するには、以下のコマンドレットを実行します。
Get-AzureRmResourceProvider -ListAvailable
リソース プロバイダー内に含まれている機能を確認するには、以下のコマンドレットを実行します。
Get-AzureRmResourceProvider -ProviderNamespece "<リソース プロバイダー名>"
実行するコマンドレットが該当するリソース プロバイダーが登録されていないと実行してもエラーになります (例として ExpressRoute 関連のコマンドレットを実行するには「Microsoft.Network」が登録されている必要があります)。リソース プロバイダーを登録するには、以下のコマンドレットを実行します。
Register-AzureRmResourceProvider -ProviderNamespace "<リソース プロバイダー名>"
登録解除する場合には、以下のコマンドレットを実行します。
Unregister-AzureRmResourceProvider -ProviderNamespace "<リソース プロバイダー名>"
[参考]
- Azure PowerShell 1.0 Preview | Microsoft Azure Blog
 https://azure.microsoft.com/en-us/blog/azps-1-0-pre/
- PowerShell Gallery | Home
 http://www.powershellgallery.com/
- Download Windows Management Framework 5.0 Production Preview from Official Microsoft Download Center
 http://www.microsoft.com/en-us/download/details.aspx?id=48729
- Azure PowerShell 1.0 Preview
 https://msdn.microsoft.com/en-us/library/mt619274.aspx

 
  
  
  
  