Skip to content

Installing PowerShell

Scope: getting PowerShell 7 (pwsh) on your machine and proving it works.

Windows

PowerShell 7 does not replace the built-in Windows PowerShell 5.1 — they install side by side:

winget install --id Microsoft.PowerShell --source winget

Launch it as pwsh (the old one remains powershell).

Mac

brew install powershell/tap/powershell

Or download the .pkg from the PowerShell releases page.

Linux

Microsoft publishes packages for major distros — see the install docs for the exact repository setup. Ubuntu example:

# (see the docs link above for the current repository steps)
sudo apt update
sudo apt install -y powershell

Check it worked

$PSVersionTable.PSVersion

You should see 7.x.x. If it says 5.1.x, you're in Windows PowerShell — type pwsh to switch.

Get-Host

confirms which shell you're actually running.

Execution policy (Windows only)

Scripts are blocked by default on Windows. For your own machine:

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

What this means: your own scripts run freely; scripts downloaded from the internet must be signed. RemoteSigned is the sane middle ground — Unrestricted is not recommended, Restricted (the default) blocks everything.

This is a speed bump, not security — it stops accidental double-click execution, not attackers. Don't treat it as a safety guarantee.

Mac/Linux don't have execution policies; scripts just run.

Keeping it updated

  • Windows: winget upgrade --id Microsoft.PowerShell
  • Mac: brew upgrade powershell
  • Linux: your package manager handles it

Check

  • [ ] $PSVersionTable.PSVersion shows 7.x
  • [ ] You can say the difference between pwsh and powershell
  • [ ] On Windows: execution policy is RemoteSigned for your user

Next: Your First Commands.