Befehle, um PowerShell Preview ohne Rückfragen zu installieren, wieder zu entfernen und in Verteilungswerkzeugen zu erkennen. Ein Befehl erscheint nur, wenn er feststeht: aus dem Manifest oder als dokumentierter Standard der jeweiligen Installer-Technik.
Passende Anleitung: Silent-Install-Parameter: MSI, NSIS, Inno Setup · Programm über Registry oder PowerShell deinstallieren
Mit winget
winget install --id Microsoft.PowerShell.Preview -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id Microsoft.PowerShell.Preview -e --silentwinget uninstall --id Microsoft.PowerShell.Preview -e --silentNach Installer
64-Bit · MSIX
Add-AppxPackage -Path PowerShellPreview-7.7.0-preview.5.msixbundleGet-AppxPackage -Name Microsoft.PowerShellPreview | Remove-AppxPackageARM64 · MSIX
Add-AppxPackage -Path PowerShellPreview-7.7.0-preview.5.msixbundleGet-AppxPackage -Name Microsoft.PowerShellPreview | Remove-AppxPackage32-Bit · MSIX
Add-AppxPackage -Path PowerShellPreview-7.7.0-preview.5.msixbundleGet-AppxPackage -Name Microsoft.PowerShellPreview | Remove-AppxPackagePowerShell: herunterladen, prüfen, installieren
Lädt die offizielle Datei herunter, prüft den SHA256-Hash und installiert still.
$url = 'https://github.com/PowerShell/PowerShell/releases/download/v7.7.0-preview.5/PowerShellPreview-7.7.0-preview.5.msixbundle'
$sha256 = 'A7F88673E17F064F8E5A21B1A2A98DC142ACAAB20AFADD8212934BD4CB2DC0C3'
$file = Join-Path $env:TEMP 'PowerShellPreview-7.7.0-preview.5.msixbundle'
Invoke-WebRequest -Uri $url -OutFile $file -UseBasicParsing
if ((Get-FileHash $file -Algorithm SHA256).Hash -ne $sha256) { throw 'SHA256 mismatch' }
Add-AppxPackage -Path $file $url = 'https://github.com/PowerShell/PowerShell/releases/download/v7.7.0-preview.5/PowerShellPreview-7.7.0-preview.5.msixbundle'
$sha256 = 'A7F88673E17F064F8E5A21B1A2A98DC142ACAAB20AFADD8212934BD4CB2DC0C3'
$file = Join-Path $env:TEMP 'PowerShellPreview-7.7.0-preview.5.msixbundle'
Invoke-WebRequest -Uri $url -OutFile $file -UseBasicParsing
if ((Get-FileHash $file -Algorithm SHA256).Hash -ne $sha256) { throw 'SHA256 mismatch' }
Add-AppxPackage -Path $file $url = 'https://github.com/PowerShell/PowerShell/releases/download/v7.7.0-preview.5/PowerShellPreview-7.7.0-preview.5.msixbundle'
$sha256 = 'A7F88673E17F064F8E5A21B1A2A98DC142ACAAB20AFADD8212934BD4CB2DC0C3'
$file = Join-Path $env:TEMP 'PowerShellPreview-7.7.0-preview.5.msixbundle'
Invoke-WebRequest -Uri $url -OutFile $file -UseBasicParsing
if ((Get-FileHash $file -Algorithm SHA256).Hash -ne $sha256) { throw 'SHA256 mismatch' }
Add-AppxPackage -Path $file