免互動安裝Microsoft Edge、解除安裝,以及在部署工具中偵測安裝狀態所用的指令。只列出確定可用的指令:來自資訊清單,或是安裝程式技術的官方預設參數。
相關教學: 靜默安裝參數總整理:MSI、NSIS、Inno Setup · 用登錄檔或PowerShell解除安裝程式
使用winget
PowerShell
winget install --id Microsoft.Edge -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id Microsoft.Edge -e --silentwinget uninstall --id Microsoft.Edge -e --silent依安裝檔
64位元 · MSI · 所有使用者 · en-US
靜默安裝
msiexec /i MicrosoftEdgeEnterpriseX64.msi /qn /norestart寫入記錄檔
msiexec /i MicrosoftEdgeEnterpriseX64.msi /qn /norestart /l*v "%TEMP%\microsoft-edge-install.log"ARM64 · MSI · 所有使用者 · en-US
靜默安裝
msiexec /i MicrosoftEdgeEnterpriseARM64.msi /qn /norestart寫入記錄檔
msiexec /i MicrosoftEdgeEnterpriseARM64.msi /qn /norestart /l*v "%TEMP%\microsoft-edge-install.log"32位元 · MSI · 所有使用者 · en-US
靜默安裝
msiexec /i MicrosoftEdgeEnterpriseX86.msi /qn /norestart寫入記錄檔
msiexec /i MicrosoftEdgeEnterpriseX86.msi /qn /norestart /l*v "%TEMP%\microsoft-edge-install.log"PowerShell:下載、驗證、安裝
下載官方檔案,驗證SHA256後靜默安裝。
install-microsoft-edge.ps1
$url = 'https://download.microsoft.com/download/9a5569d2-a134-42cb-940f-d7225433a20c/MicrosoftEdgeEnterpriseX64.msi'
$sha256 = 'F7BC427C4D26AEFE12BD492A24959CC6CA328AEA2851614637D7133CAE329071'
$file = Join-Path $env:TEMP 'MicrosoftEdgeEnterpriseX64.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 install-microsoft-edge.ps1
$url = 'https://download.microsoft.com/download/9a5569d2-a134-42cb-940f-d7225433a20c/MicrosoftEdgeEnterpriseARM64.msi'
$sha256 = 'FBC24254C81CE7A0C1FB776EE6D1F58FECE30FFEDEE6F3613637117B51247918'
$file = Join-Path $env:TEMP 'MicrosoftEdgeEnterpriseARM64.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 install-microsoft-edge.ps1
$url = 'https://download.microsoft.com/download/9a5569d2-a134-42cb-940f-d7225433a20c/MicrosoftEdgeEnterpriseX86.msi'
$sha256 = '07D84F7FA262AB981E4DB3D1CE99380521397298B631FAE295FE8A86CA8013FC'
$file = Join-Path $env:TEMP 'MicrosoftEdgeEnterpriseX86.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