はじめに
MS365でPowerShellによる操作を行う必要があったのですが、その時にAzurePowerShellなるものをインストールする必要があったため、備忘のため記録。
なお、Microsoftの公式サイトには一応手順はありますが、余分なものが多いので、最小限の手続きをまとめています。
前提
- OSはMac OS Catalina
- Windowsとは違うメッセージが出るかもしれません。
手順
PowerShellを起動
PowerShellを起動する。
ローカルユーザのみインストールであれば管理者権限は不要。
インストールコマンドを入力
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
}
途中、以下のようなダイアログで止まるので、「Y」か「A」を入力して、Enter。
You are installing the modules from an untrusted repository. If you trust this
repository, change its InstallationPolicy value by running the Set-PSRepository
cmdlet. Are you sure you want to install the modules from 'PSGallery'?
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help
(default is "N"):
エラーがなければ、インストール完了。
公式サイトはいろいろな情報が乗っているのですが、実際やることはこれだけです。