LoginSignup
1
1

More than 3 years have passed since last update.

Azure PowerShellをインストールする

Last updated at Posted at 2021-03-13

Azure PowerShellとは

AzureのセットアップをしているとAzure PowerShellという文字をよく目にするので普通のPowerShellと何が違うのか調べてみました。
ググってみたところ、Azure用のコマンドレットのセットのことをAzure PowerShellと呼んでいるらしいです。

Azure PowerShellは、PowerShellコマンドラインからAzureリソースを直接管理するためのコマンドレットのセットです。

Azure PowerShellのインストール

ref. https://docs.microsoft.com/ja-jp/powershell/azure/install-az-ps?view=azps-2.8.0

ドキュメントに従いインストールします。

if (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
}

プロンプトが表示されるので、[A] Yes to Allを選択します。

Untrusted repository

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"): A

サインイン

インストールが終わったらAzureにサインインできるか確認してみます。

# Connect to Azure with a browser sign in token
Connect-AzAccount

Azure PowerShellのアップデート

Install-Moduleを使用してインストールした場合は、Update-Moduleを使用してアップデートする必要があるようです。
(MSIでインストールしたら、MSIでアップデートする必要があるとのこと。つまり、アップデートにはインストールしたのと同じ方法を使用しなければならない)

以上

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1