دستورهایی برای نصب PowerShell Preview بدون پنجره و پرسش، حذف دوباره آن و تشخیص آن در ابزارهای توزیع نرمافزار. هر دستور فقط وقتی نمایش داده میشود که قطعی باشد: از مانیفست یا از پیشفرض مستند فناوری نصبکننده.
آموزش مرتبط: سوییچهای نصب بیصدا: MSI، NSIS و Inno Setup · حذف برنامه با رجیستری یا PowerShell در ویندوز
با winget
PowerShell
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 --silentبر اساس نصبکننده
۶۴ بیتی · MSIX
نصب بیصدا
Add-AppxPackage -Path PowerShellPreview-7.7.0-preview.5.msixbundleحذف نصب
Get-AppxPackage -Name Microsoft.PowerShellPreview | Remove-AppxPackageARM64 · MSIX
نصب بیصدا
Add-AppxPackage -Path PowerShellPreview-7.7.0-preview.5.msixbundleحذف نصب
Get-AppxPackage -Name Microsoft.PowerShellPreview | Remove-AppxPackage۳۲ بیتی · MSIX
نصب بیصدا
Add-AppxPackage -Path PowerShellPreview-7.7.0-preview.5.msixbundleحذف نصب
Get-AppxPackage -Name Microsoft.PowerShellPreview | Remove-AppxPackagePowerShell: دانلود، بررسی، نصب
فایل رسمی را دانلود میکند، هش SHA256 آن را بررسی میکند و آن را بیصدا نصب میکند.
install-powershell-preview.ps1
$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 install-powershell-preview.ps1
$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 install-powershell-preview.ps1
$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