Azure Data CLIを確認画面なしでインストール・アンインストールし、展開ツールで検出するためのコマンドです。マニフェストの記載か、インストーラー技術の既定値として確実なコマンドだけを表示しています。
関連ガイド: サイレントインストールのオプション一覧 · レジストリとPowerShellでアンインストールする方法
wingetを使う
PowerShell
winget install --id Microsoft.Azure.DataCLI -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id Microsoft.Azure.DataCLI -e --silentwinget uninstall --id Microsoft.Azure.DataCLI -e --silentインストーラー別
64ビット · MSI
サイレントインストール
msiexec /i azdata-cli-20.3.14.msi /qn /norestartログを出力
msiexec /i azdata-cli-20.3.14.msi /qn /norestart /l*v "%TEMP%\azure-data-cli-install.log"アンインストール
msiexec /x {1C7097D3-B00B-4F1A-B9A6-A00C1CD49EA4} /qn /norestart- MSIプロダクトコード
- {1C7097D3-B00B-4F1A-B9A6-A00C1CD49EA4}
- アンインストール用レジストリキー
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{1C7097D3-B00B-4F1A-B9A6-A00C1CD49EA4}
PowerShell:ダウンロード・検証・インストール
公式ファイルをダウンロードし、SHA256を検証してからサイレントインストールします。
install-azure-data-cli.ps1
$url = 'https://download.microsoft.com/download/f/f/f/fffaa914-d4f7-4885-89c7-696bbfe7670a/azdata-cli-20.3.14.msi'
$sha256 = '7F58F76FCB83232A8D806BAF1FDAE15B452D72D0360EC758FA04B5966E4E24DE'
$file = Join-Path $env:TEMP 'azdata-cli-20.3.14.msi'
Invoke-WebRequest -Uri $url -OutFile $file -UseBasicParsing
if ((Get-FileHash $file -Algorithm SHA256).Hash -ne $sha256) { throw 'SHA256 mismatch' }
Start-Process msiexec.exe -ArgumentList '/i', ('"{0}"' -f $file), '/qn', '/norestart' -Wait