免互動安裝HardwareVisualizer、解除安裝,以及在部署工具中偵測安裝狀態所用的指令。只列出確定可用的指令:來自資訊清單,或是安裝程式技術的官方預設參數。
相關教學: 靜默安裝參數總整理:MSI、NSIS、Inno Setup · 用登錄檔或PowerShell解除安裝程式
使用winget
PowerShell
winget install --id shm11C3.HardwareVisualizer -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id shm11C3.HardwareVisualizer -e --silentwinget uninstall --id shm11C3.HardwareVisualizer -e --silent依安裝檔
64位元 · MSI · en-US
靜默安裝
msiexec /i HardwareVisualizer_1.11.2_x64_en-US.msi /qn /norestart寫入記錄檔
msiexec /i HardwareVisualizer_1.11.2_x64_en-US.msi /qn /norestart /l*v "%TEMP%\hardwarevisualizer-install.log"解除安裝
msiexec /x {F846B2C7-08ED-45DB-9028-BFF96A5210B7} /qn /norestart- MSI產品代碼
- {F846B2C7-08ED-45DB-9028-BFF96A5210B7}
- 解除安裝登錄機碼
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{F846B2C7-08ED-45DB-9028-BFF96A5210B7}
PowerShell:下載、驗證、安裝
下載官方檔案,驗證SHA256後靜默安裝。
install-hardwarevisualizer.ps1
$url = 'https://github.com/shm11C3/HardwareVisualizer/releases/download/v1.11.2/HardwareVisualizer_1.11.2_x64_en-US.msi'
$sha256 = '446804A583145C5451707E3F0A7694125830E71AC9322133914E3425AE54202E'
$file = Join-Path $env:TEMP 'HardwareVisualizer_1.11.2_x64_en-US.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