Install PowerShell 7
Why Not WinGet?
Download the MSI
Install the MSI
After Installation
Last updated
Was this helpful?
Was this helpful?
# Update $Version to match the latest release:
# https://github.com/PowerShell/PowerShell/releases/latest
$Version = '7.6.1'
$Arch = if ($env:PROCESSOR_ARCHITECTURE -eq 'ARM64') { 'arm64' } else { 'x64' }
$MsiFileName = "PowerShell-$Version-win-$Arch.msi"
$MsiUrl = "https://github.com/PowerShell/PowerShell/releases/download/v$Version/$MsiFileName"
$DownloadFolder = "$env:ProgramData\OSDeployCore\software\Microsoft.PowerShell"
$MsiPath = Join-Path $DownloadFolder $MsiFileName
if (-not (Test-Path $DownloadFolder)) {
New-Item -Path $DownloadFolder -ItemType Directory -Force | Out-Null
}
curl.exe -L -o $MsiPath $MsiUrl# Update $Version to match the version you downloaded
$Version = '7.6.1'
$Arch = if ($env:PROCESSOR_ARCHITECTURE -eq 'ARM64') { 'arm64' } else { 'x64' }
$MsiPath = "$env:ProgramData\OSDeployCore\software\Microsoft.PowerShell\PowerShell-$Version-win-$Arch.msi"
$msiParams = @(
"/package `"$MsiPath`""
'/quiet'
'ADD_EXPLORER_CONTEXT_MENU_OPENPOWERSHELL=1'
'ADD_FILE_CONTEXT_MENU_RUNPOWERSHELL=1'
'ENABLE_PSREMOTING=1'
'REGISTER_MANIFEST=1'
'USE_MU=1'
'ENABLE_MU=1'
'ADD_PATH=1'
)
msiexec.exe @msiParamspwsh --version