คำสั่งสำหรับติดตั้ง PowerShell Preview โดยไม่มีหน้าต่างถามตอบ ถอนการติดตั้ง และตรวจจับจากเครื่องมือกระจายซอฟต์แวร์ เราแสดงคำสั่งเฉพาะเมื่อแน่ใจเท่านั้น คือมาจากแมนิเฟสต์หรือค่าเริ่มต้นที่มีเอกสารของเทคโนโลยีตัวติดตั้งนั้น
คู่มือที่เกี่ยวข้อง: พารามิเตอร์ติดตั้งแบบเงียบ: MSI, NSIS, Inno Setup · ถอนการติดตั้งโปรแกรมผ่านรีจิสทรีหรือ PowerShell
ใช้ 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 --silentแยกตามตัวติดตั้ง
64 บิต · 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 บิต · MSIX
Add-AppxPackage -Path PowerShellPreview-7.7.0-preview.5.msixbundleGet-AppxPackage -Name Microsoft.PowerShellPreview | Remove-AppxPackagePowerShell: ดาวน์โหลด ตรวจสอบ ติดตั้ง
ดาวน์โหลดไฟล์ทางการ ตรวจสอบค่า SHA256 แล้วติดตั้งแบบเงียบ
$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