免互動安裝Puppet Development Kit、解除安裝,以及在部署工具中偵測安裝狀態所用的指令。只列出確定可用的指令:來自資訊清單,或是安裝程式技術的官方預設參數。
相關教學: 靜默安裝參數總整理:MSI、NSIS、Inno Setup · 用登錄檔或PowerShell解除安裝程式
使用winget
PowerShell
winget install --id Puppet.pdk -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id Puppet.pdk -e --silentwinget uninstall --id Puppet.pdk -e --silent依安裝檔
64位元 · MSI · 所有使用者
靜默安裝
msiexec /i pdk-3.4.0.1-x64.msi /qn /norestart寫入記錄檔
msiexec /i pdk-3.4.0.1-x64.msi /qn /norestart /l*v "%TEMP%\puppet-development-kit-install.log"解除安裝
msiexec /x {AD83C866-5741-4220-8633-CB4007558112} /qn /norestart- MSI產品代碼
- {AD83C866-5741-4220-8633-CB4007558112}
- 解除安裝登錄機碼
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{AD83C866-5741-4220-8633-CB4007558112}
- UpgradeCode
- {2F79F42E-955C-4E69-AB87-DB4ED9EDF2D9}
PowerShell:下載、驗證、安裝
下載官方檔案,驗證SHA256後靜默安裝。
install-puppet-development-kit.ps1
$url = 'https://downloads.puppet.com/windows/puppet-tools/pdk-3.4.0.1-x64.msi'
$sha256 = '46136B41031866FB5ACE514AE263CA64991497A500CE80D3C4640CB7B6EDBF1C'
$file = Join-Path $env:TEMP 'pdk-3.4.0.1-x64.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