免互動安裝Slack、解除安裝,以及在部署工具中偵測安裝狀態所用的指令。只列出確定可用的指令:來自資訊清單,或是安裝程式技術的官方預設參數。
相關教學: 靜默安裝參數總整理:MSI、NSIS、Inno Setup · 用登錄檔或PowerShell解除安裝程式
使用winget
PowerShell
winget install --id SlackTechnologies.Slack -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id SlackTechnologies.Slack -e --silentwinget uninstall --id SlackTechnologies.Slack -e --silent依安裝檔
64位元 · EXE · 僅目前使用者
靜默安裝
SlackSetup.exe --silent- 解除安裝登錄機碼
- HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\slack
64位元 · MSIX
靜默安裝
Add-AppxPackage -Path Slack.msix解除安裝
Get-AppxPackage -Name com.tinyspeck.slackdesktop | Remove-AppxPackageARM64 · MSIX
靜默安裝
Add-AppxPackage -Path Slack.msix解除安裝
Get-AppxPackage -Name com.tinyspeck.slackdesktop | Remove-AppxPackagePowerShell:下載、驗證、安裝
下載官方檔案,驗證SHA256後靜默安裝。
install-slack.ps1
$url = 'https://downloads.slack-edge.com/desktop-releases/windows/x64/4.52.182/SlackSetup.exe'
$sha256 = 'E42DBA9622A297106F16A11F148C86E08BEEEEA6FE5BFD63DE4C606B513AB184'
$file = Join-Path $env:TEMP 'SlackSetup.exe'
Invoke-WebRequest -Uri $url -OutFile $file -UseBasicParsing
if ((Get-FileHash $file -Algorithm SHA256).Hash -ne $sha256) { throw 'SHA256 mismatch' }
Start-Process -FilePath $file -ArgumentList '--silent' -Wait install-slack.ps1
$url = 'https://downloads.slack-edge.com/desktop-releases/windows/x64/4.52.182/Slack.msix'
$sha256 = '93B31D64B3DDD5035937140EC5D03D001D99C79072EB6984551233C8258C2EDE'
$file = Join-Path $env:TEMP 'Slack.msix'
Invoke-WebRequest -Uri $url -OutFile $file -UseBasicParsing
if ((Get-FileHash $file -Algorithm SHA256).Hash -ne $sha256) { throw 'SHA256 mismatch' }
Add-AppxPackage -Path $file install-slack.ps1
$url = 'https://downloads.slack-edge.com/desktop-releases/windows/arm64/4.52.182/Slack.msix'
$sha256 = 'EAB4C88086BB93A2F4BBBDEBC8E3B8193A94FCE99D7CA18525B567670E7257E3'
$file = Join-Path $env:TEMP 'Slack.msix'
Invoke-WebRequest -Uri $url -OutFile $file -UseBasicParsing
if ((Get-FileHash $file -Algorithm SHA256).Hash -ne $sha256) { throw 'SHA256 mismatch' }
Add-AppxPackage -Path $file