Good — you can install the latest PowerShell (PowerShell 7.x, a separate modern release that runs side‑by‑side with the built‑in Windows PowerShell) right from the elevated PowerShell window you already have open. The easiest, safest method on Windows 11 is to use winget (Windows Package Manager). Winget will fetch the latest stable release for you; if winget isn’t available I’ll show the MSI fallback from the official GitHub releases page.
I’ll give the winget method first (recommended), then fallbacks and verification. I’ll also include the exact commands you can paste into your elevated PowerShell.
Sources / where this comes from
- Microsoft’s PowerShell install docs (recommends winget). (github.com)
- Official PowerShell releases (MSI / MSIX / ZIP) on the PowerShell GitHub releases page. (github.com)
A — Recommended: install latest PowerShell using winget (fast, picks latest)
- Make sure your PowerShell window is running as Administrator (you already opened an elevated window — good).
- Run this command (it accepts the winget source/package agreements to avoid prompts):
winget install --id Microsoft.PowerShell --source winget --accept-package-agreements --accept-source-agreements
Notes:
- winget is included with modern Windows 11 builds; this command will install the latest stable PowerShell 7.x MSI for x64 systems automatically. (github.com)
- If winget prompts for permission, confirm the prompt. If winget says it’s not found, see the fallback steps below.
B — Fallback: download & run the MSI from the official PowerShell releases page
If winget isn’t available or you prefer a manual installer:
- Open your web browser and go to the official PowerShell GitHub releases page (PowerShell/PowerShell → Releases). Download the MSI matching your architecture (most likely PowerShell-7.4.x-win-x64.msi). (github.com)
- Double‑click the MSI and follow the installer (Run as Administrator). Accept defaults unless you need a custom install location.
- The installer places the new PowerShell executable as pwsh.exe and it runs side‑by‑side with Windows PowerShell (powershell.exe).
C — Verify installation and start using PowerShell 7
- After install, open a new Start menu entry named “PowerShell 7” or run pwsh from a Command Prompt / Run box.
- In the new pwsh session run:
$PSVersionTable
You should see a PSVersion like 7.x.x (e.g., 7.4.x). That confirms the modern PowerShell is installed.
If you want to check from your current (old) Windows PowerShell immediately after install, run:
pwsh -NoProfile -Command '$PSVersionTable'
D — If winget is missing or fails
- Install the App Installer (which provides winget) from Microsoft Store (search “App Installer”) and retry the winget command. Microsoft’s docs show winget as the recommended route. (github.com)
- Or download the MSI from the GitHub releases page and run it (see B).
E — Uninstalling / rolling back
- To remove PowerShell 7 later: Settings → Apps → Installed apps → search “PowerShell” → Uninstall, or use winget uninstall --id Microsoft.PowerShell.
F — A couple of safety notes
- Installing PowerShell 7 does NOT replace Windows PowerShell 5.1 — both can coexist; PowerShell 7’s executable is pwsh.exe.
- Run the installers with admin rights. If you use winget, run it from an elevated prompt as you already have.
- If you plan to run scripts downloaded from the internet, check Execution Policy and always be cautious (see Microsoft guidance).
Would you like me to:
- A) Paste the single winget command again so you can copy/paste it into your elevated window now?
- B) Walk you through the GitHub MSI download step‑by‑step (I can provide the exact link to the latest x64 MSI)?
- C) Help you install winget/App Installer first if your winget command isn’t recognized?
Tell me which option you prefer and I’ll give the exact next command/clicks.