mongodb-database-toolsを確認画面なしでインストール・アンインストールし、展開ツールで検出するためのコマンドです。マニフェストの記載か、インストーラー技術の既定値として確実なコマンドだけを表示しています。
関連ガイド: サイレントインストールのオプション一覧 · レジストリとPowerShellでアンインストールする方法
インストーラー別
64ビット · MSI
サイレントインストール
msiexec /i mongodb-database-tools-windows-x86_64-100.14.0.msi /qn /norestartログを出力
msiexec /i mongodb-database-tools-windows-x86_64-100.14.0.msi /qn /norestart /l*v "%TEMP%\mongodb-database-tools-install.log"PowerShell:ダウンロード・検証・インストール
公式ファイルをダウンロードし、SHA256を検証してからサイレントインストールします。
install-mongodb-database-tools.ps1
$url = 'https://fastdl.mongodb.org/tools/db/mongodb-database-tools-windows-x86_64-100.14.0.msi'
$sha256 = '66887285752BA3C1C26D7303A33692B0B10A99420443B45A4A7063A3E1A55999'
$file = Join-Path $env:TEMP 'mongodb-database-tools-windows-x86_64-100.14.0.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