دستورهایی برای نصب PowerShell بدون پنجره و پرسش، حذف دوباره آن و تشخیص آن در ابزارهای توزیع نرمافزار. هر دستور فقط وقتی نمایش داده میشود که قطعی باشد: از مانیفست یا از پیشفرض مستند فناوری نصبکننده.
آموزش مرتبط: سوییچهای نصب بیصدا: MSI، NSIS و Inno Setup · حذف برنامه با رجیستری یا PowerShell در ویندوز
با winget
PowerShell
winget install --id Microsoft.PowerShell -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id Microsoft.PowerShell -e --silentwinget uninstall --id Microsoft.PowerShell -e --silentبر اساس نصبکننده
۶۴ بیتی · MSIX
نصب بیصدا
Add-AppxPackage -Path PowerShell-7.6.9.msixbundleحذف نصب
Get-AppxPackage -Name Microsoft.PowerShell | Remove-AppxPackage۶۴ بیتی · MSI · همه کاربران
نصب بیصدا
msiexec /i PowerShell-7.6.9-win-x64.msi /qn /norestartنوشتن فایل لاگ
msiexec /i PowerShell-7.6.9-win-x64.msi /qn /norestart /l*v "%TEMP%\powershell-install.log"حذف نصب
msiexec /x {5417B253-1A6D-4638-BC94-743A6EC2E6F4} /qn /norestart- کد محصول MSI
- {5417B253-1A6D-4638-BC94-743A6EC2E6F4}
- کلید حذف در رجیستری
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{5417B253-1A6D-4638-BC94-743A6EC2E6F4}
ARM64 · MSIX
نصب بیصدا
Add-AppxPackage -Path PowerShell-7.6.9.msixbundleحذف نصب
Get-AppxPackage -Name Microsoft.PowerShell | Remove-AppxPackageARM64 · MSI · همه کاربران
نصب بیصدا
msiexec /i PowerShell-7.6.9-win-arm64.msi /qn /norestartنوشتن فایل لاگ
msiexec /i PowerShell-7.6.9-win-arm64.msi /qn /norestart /l*v "%TEMP%\powershell-install.log"حذف نصب
msiexec /x {A55580A2-6A8D-45DB-A673-0601CBA518C8} /qn /norestart- کد محصول MSI
- {A55580A2-6A8D-45DB-A673-0601CBA518C8}
- کلید حذف در رجیستری
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{A55580A2-6A8D-45DB-A673-0601CBA518C8}
۳۲ بیتی · MSIX
نصب بیصدا
Add-AppxPackage -Path PowerShell-7.6.9.msixbundleحذف نصب
Get-AppxPackage -Name Microsoft.PowerShell | Remove-AppxPackage۳۲ بیتی · MSI · همه کاربران
نصب بیصدا
msiexec /i PowerShell-7.6.9-win-x86.msi /qn /norestartنوشتن فایل لاگ
msiexec /i PowerShell-7.6.9-win-x86.msi /qn /norestart /l*v "%TEMP%\powershell-install.log"حذف نصب
msiexec /x {F2DBB6E6-6A92-4712-A77E-350ADA889C0A} /qn /norestart- کد محصول MSI
- {F2DBB6E6-6A92-4712-A77E-350ADA889C0A}
- کلید حذف در رجیستری
- HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{F2DBB6E6-6A92-4712-A77E-350ADA889C0A}
PowerShell: دانلود، بررسی، نصب
فایل رسمی را دانلود میکند، هش SHA256 آن را بررسی میکند و آن را بیصدا نصب میکند.
install-powershell.ps1
$url = 'https://github.com/PowerShell/PowerShell/releases/download/v7.6.9/PowerShell-7.6.9.msixbundle'
$sha256 = 'DA75C8AA23EDDA52E888FB586A46B923AB37A7C243719C2E8914B00130C5917A'
$file = Join-Path $env:TEMP 'PowerShell-7.6.9.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.ps1
$url = 'https://github.com/PowerShell/PowerShell/releases/download/v7.6.9/PowerShell-7.6.9-win-x64.msi'
$sha256 = '50D33C7494AAF82B987CFD4DE3F232D04F91FDD4C0DEECA8A669CCED3E7CF8F9'
$file = Join-Path $env:TEMP 'PowerShell-7.6.9-win-x64.msi'
Invoke-WebRequest -Uri $url -OutFile $file -UseBasicParsing
if ((Get-FileHash $file -Algorithm SHA256).Hash -ne $sha256) { throw 'SHA256 mismatch' }
Start-Process msiexec.exe -ArgumentList '/i', ('"{0}"' -f $file), '/qn', '/norestart' -Wait install-powershell.ps1
$url = 'https://github.com/PowerShell/PowerShell/releases/download/v7.6.9/PowerShell-7.6.9.msixbundle'
$sha256 = 'DA75C8AA23EDDA52E888FB586A46B923AB37A7C243719C2E8914B00130C5917A'
$file = Join-Path $env:TEMP 'PowerShell-7.6.9.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.ps1
$url = 'https://github.com/PowerShell/PowerShell/releases/download/v7.6.9/PowerShell-7.6.9-win-arm64.msi'
$sha256 = 'F29D127A798DA0D3FEC9224171AE4D85453ECB466CE53A957237BCA4008C1D2B'
$file = Join-Path $env:TEMP 'PowerShell-7.6.9-win-arm64.msi'
Invoke-WebRequest -Uri $url -OutFile $file -UseBasicParsing
if ((Get-FileHash $file -Algorithm SHA256).Hash -ne $sha256) { throw 'SHA256 mismatch' }
Start-Process msiexec.exe -ArgumentList '/i', ('"{0}"' -f $file), '/qn', '/norestart' -Wait install-powershell.ps1
$url = 'https://github.com/PowerShell/PowerShell/releases/download/v7.6.9/PowerShell-7.6.9.msixbundle'
$sha256 = 'DA75C8AA23EDDA52E888FB586A46B923AB37A7C243719C2E8914B00130C5917A'
$file = Join-Path $env:TEMP 'PowerShell-7.6.9.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.ps1
$url = 'https://github.com/PowerShell/PowerShell/releases/download/v7.6.9/PowerShell-7.6.9-win-x86.msi'
$sha256 = '067659D573A953FF93D1BDD87D7CDD3C34BF1B9C8B9226C5C2164215F3C37608'
$file = Join-Path $env:TEMP 'PowerShell-7.6.9-win-x86.msi'
Invoke-WebRequest -Uri $url -OutFile $file -UseBasicParsing
if ((Get-FileHash $file -Algorithm SHA256).Hash -ne $sha256) { throw 'SHA256 mismatch' }
Start-Process msiexec.exe -ArgumentList '/i', ('"{0}"' -f $file), '/qn', '/norestart' -Wait