免互動安裝Microsoft .NET Framework Developer Pack、解除安裝,以及在部署工具中偵測安裝狀態所用的指令。只列出確定可用的指令:來自資訊清單,或是安裝程式技術的官方預設參數。
相關教學: 靜默安裝參數總整理:MSI、NSIS、Inno Setup · 用登錄檔或PowerShell解除安裝程式
使用winget
PowerShell
winget install --id Microsoft.DotNet.Framework.DeveloperPack_4 -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id Microsoft.DotNet.Framework.DeveloperPack_4 -e --silentwinget uninstall --id Microsoft.DotNet.Framework.DeveloperPack_4 -e --silent依安裝檔
64位元 · EXE
靜默安裝
NDP481-DevPack-ENU.exe /install /quiet /norestart解除安裝
msiexec /x {81EF376F-C9A1-42A3-8997-22A1DE4687F0} /qn /norestart- MSI產品代碼
- {81ef376f-c9a1-42a3-8997-22a1de4687f0}
- 解除安裝登錄機碼
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{81ef376f-c9a1-42a3-8997-22a1de4687f0}
- DisplayVersion
- 4.8.09037
ARM64 · EXE
靜默安裝
NDP481-DevPack-ENU.exe /install /quiet /norestart解除安裝
msiexec /x {81EF376F-C9A1-42A3-8997-22A1DE4687F0} /qn /norestart- MSI產品代碼
- {81ef376f-c9a1-42a3-8997-22a1de4687f0}
- 解除安裝登錄機碼
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{81ef376f-c9a1-42a3-8997-22a1de4687f0}
- DisplayVersion
- 4.8.09037
32位元 · EXE
靜默安裝
NDP481-DevPack-ENU.exe /install /quiet /norestart解除安裝
msiexec /x {81EF376F-C9A1-42A3-8997-22A1DE4687F0} /qn /norestart- MSI產品代碼
- {81ef376f-c9a1-42a3-8997-22a1de4687f0}
- 解除安裝登錄機碼
- HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{81ef376f-c9a1-42a3-8997-22a1de4687f0}
- DisplayVersion
- 4.8.09037
不限架構 · EXE
靜默安裝
NDP481-DevPack-ENU.exe /install /quiet /norestart解除安裝
msiexec /x {81EF376F-C9A1-42A3-8997-22A1DE4687F0} /qn /norestart- MSI產品代碼
- {81ef376f-c9a1-42a3-8997-22a1de4687f0}
- 解除安裝登錄機碼
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{81ef376f-c9a1-42a3-8997-22a1de4687f0}
- DisplayVersion
- 4.8.09037
PowerShell:下載、驗證、安裝
下載官方檔案,驗證SHA256後靜默安裝。
install-microsoft-net-framework-developer-pack.ps1
$url = 'https://download.microsoft.com/download/8/1/8/81877d8b-a9b2-4153-9ad2-63a6441d11dd/NDP481-DevPack-ENU.exe'
$sha256 = 'FD9AE4B63CBC8F7637249C4B29D25281B1F70FBE6D650109DCBF2BDF596CF994'
$file = Join-Path $env:TEMP 'NDP481-DevPack-ENU.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 '/install /quiet /norestart' -Wait install-microsoft-net-framework-developer-pack.ps1
$url = 'https://download.microsoft.com/download/8/1/8/81877d8b-a9b2-4153-9ad2-63a6441d11dd/NDP481-DevPack-ENU.exe'
$sha256 = 'FD9AE4B63CBC8F7637249C4B29D25281B1F70FBE6D650109DCBF2BDF596CF994'
$file = Join-Path $env:TEMP 'NDP481-DevPack-ENU.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 '/install /quiet /norestart' -Wait install-microsoft-net-framework-developer-pack.ps1
$url = 'https://download.microsoft.com/download/8/1/8/81877d8b-a9b2-4153-9ad2-63a6441d11dd/NDP481-DevPack-ENU.exe'
$sha256 = 'FD9AE4B63CBC8F7637249C4B29D25281B1F70FBE6D650109DCBF2BDF596CF994'
$file = Join-Path $env:TEMP 'NDP481-DevPack-ENU.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 '/install /quiet /norestart' -Wait install-microsoft-net-framework-developer-pack.ps1
$url = 'https://download.microsoft.com/download/8/1/8/81877d8b-a9b2-4153-9ad2-63a6441d11dd/NDP481-DevPack-ENU.exe'
$sha256 = 'FD9AE4B63CBC8F7637249C4B29D25281B1F70FBE6D650109DCBF2BDF596CF994'
$file = Join-Path $env:TEMP 'NDP481-DevPack-ENU.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 '/install /quiet /norestart' -Wait