Microsoft .NET Framework Runtime 4.8.1を確認画面なしでインストール・アンインストールし、展開ツールで検出するためのコマンドです。マニフェストの記載か、インストーラー技術の既定値として確実なコマンドだけを表示しています。
関連ガイド: サイレントインストールのオプション一覧 · レジストリとPowerShellでアンインストールする方法
wingetを使う
PowerShell
winget install --id Microsoft.DotNet.Framework.Runtime -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id Microsoft.DotNet.Framework.Runtime -e --silentwinget uninstall --id Microsoft.DotNet.Framework.Runtime -e --silentインストーラー別
64ビット · EXE
サイレントインストール
NDP481-x86-x64-AllOS-ENU.exe /passive /AcceptEULA /norestartARM64 · EXE
サイレントインストール
NDP481-x86-x64-AllOS-ENU.exe /passive /AcceptEULA /norestart32ビット · EXE
サイレントインストール
NDP481-x86-x64-AllOS-ENU.exe /passive /AcceptEULA /norestartCPU共通 · EXE
サイレントインストール
NDP481-x86-x64-AllOS-ENU.exe /passive /AcceptEULA /norestartPowerShell:ダウンロード・検証・インストール
公式ファイルをダウンロードし、SHA256を検証してからサイレントインストールします。
install-microsoft-net-framework-runtime-4-8-1.ps1
$url = 'https://download.microsoft.com/download/4/b/2/cd00d4ed-ebdd-49ee-8a33-eabc3d1030e3/NDP481-x86-x64-AllOS-ENU.exe'
$sha256 = 'C0CA2E0C9CD18A24A0A77369A13FAE2C2C4E8BC83355DD24E5DDC00F9D791FE3'
$file = Join-Path $env:TEMP 'NDP481-x86-x64-AllOS-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 '/passive /AcceptEULA /norestart' -Wait install-microsoft-net-framework-runtime-4-8-1.ps1
$url = 'https://download.microsoft.com/download/4/b/2/cd00d4ed-ebdd-49ee-8a33-eabc3d1030e3/NDP481-x86-x64-AllOS-ENU.exe'
$sha256 = 'C0CA2E0C9CD18A24A0A77369A13FAE2C2C4E8BC83355DD24E5DDC00F9D791FE3'
$file = Join-Path $env:TEMP 'NDP481-x86-x64-AllOS-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 '/passive /AcceptEULA /norestart' -Wait install-microsoft-net-framework-runtime-4-8-1.ps1
$url = 'https://download.microsoft.com/download/4/b/2/cd00d4ed-ebdd-49ee-8a33-eabc3d1030e3/NDP481-x86-x64-AllOS-ENU.exe'
$sha256 = 'C0CA2E0C9CD18A24A0A77369A13FAE2C2C4E8BC83355DD24E5DDC00F9D791FE3'
$file = Join-Path $env:TEMP 'NDP481-x86-x64-AllOS-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 '/passive /AcceptEULA /norestart' -Wait install-microsoft-net-framework-runtime-4-8-1.ps1
$url = 'https://download.microsoft.com/download/4/b/2/cd00d4ed-ebdd-49ee-8a33-eabc3d1030e3/NDP481-x86-x64-AllOS-ENU.exe'
$sha256 = 'C0CA2E0C9CD18A24A0A77369A13FAE2C2C4E8BC83355DD24E5DDC00F9D791FE3'
$file = Join-Path $env:TEMP 'NDP481-x86-x64-AllOS-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 '/passive /AcceptEULA /norestart' -Wait