免互動安裝Snowflake CLI、解除安裝,以及在部署工具中偵測安裝狀態所用的指令。只列出確定可用的指令:來自資訊清單,或是安裝程式技術的官方預設參數。
相關教學: 靜默安裝參數總整理:MSI、NSIS、Inno Setup · 用登錄檔或PowerShell解除安裝程式
使用winget
PowerShell
winget install --id Snowflake.SnowflakeCLI -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id Snowflake.SnowflakeCLI -e --silentwinget uninstall --id Snowflake.SnowflakeCLI -e --silent依安裝檔
64位元 · MSI · 所有使用者
靜默安裝
msiexec /i snowflake-cli-3.31.0.0-x86_64.msi /qn /norestart寫入記錄檔
msiexec /i snowflake-cli-3.31.0.0-x86_64.msi /qn /norestart /l*v "%TEMP%\snowflake-cli-install.log"解除安裝
msiexec /x {A257D756-1206-43EE-A024-D1747654F8DD} /qn /norestart- MSI產品代碼
- {A257D756-1206-43EE-A024-D1747654F8DD}
- 解除安裝登錄機碼
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{A257D756-1206-43EE-A024-D1747654F8DD}
- UpgradeCode
- {74BDE2A7-BA7F-3B99-A9C9-67B28155C13A}
PowerShell:下載、驗證、安裝
下載官方檔案,驗證SHA256後靜默安裝。
install-snowflake-cli.ps1
$url = 'https://sfc-repo.snowflakecomputing.com/snowflake-cli/windows_x86_64/3.31.0/snowflake-cli-3.31.0.0-x86_64.msi'
$sha256 = '11A0F9A4391E0C9F5B0B9C8170F2FBECAE0B3C98DC2BCD104D63FAEDC93DDD80'
$file = Join-Path $env:TEMP 'snowflake-cli-3.31.0.0-x86_64.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