Powershell で Azure AZ コマンドを使えるようにする

スポンサーリンク

1. Powrshell を管理者権限で起動

2. Powershell で以下のコマンドを実行

コマンドの内容はAzure RMモジュールがインストールされているか確認し、インストールされていなければ、AZモジュールをインストールするといったもの。
(AzureRM と AZモジュールは共存できないため)

if ($PSVersionTable.PSEdition -eq ‘Desktop’ -and (Get-Module -Name AzureRM -ListAvailable)) { Write-Warning -Message (‘Az module not installed. Having both the AzureRM and ‘ + ‘Az modules installed at the same time is not supported.’) } else { Install-Module -Name Az -AllowClobber -Scope CurrentUser }

参考:Azure PowerShell をインストールする

3. Powershell のスクリプトの実行許可をする

以下のコマンドを実行し、Powershellのスクリプトの実行を許可

PowerShell Set-ExecutionPolicy RemoteSigned

以上

コメント