PowerShell, Windows PowerShell and the Terminal

The terminal is the window, the shell is the program that runs your commands, and the prompt is where it waits for you; Windows has two PowerShells, and $PSVersionTable tells you which one you're in.

Novice · PowerShell · Operating System · Updated

After this lesson you can

  • Tell apart the terminal (the window), the shell (the program that runs commands) and the prompt (where it waits for you)
  • Tell PowerShell 7 from Windows PowerShell 5.1 by its name, its program and $PSVersionTable

Key takeaways

  • The terminal is the window you type in. The shell is the program inside it that runs your commands. The prompt is where the shell waits for the next one.
  • Windows Terminal can open several shells, each in its own tab, such as PowerShell, Windows PowerShell and Command Prompt.
  • Windows PowerShell 5.1 comes with Windows and runs only there. PowerShell 7 is the one you install, runs on Windows, Mac and Linux, and gets the new features.
  • $PSVersionTable.PSVersion shows the version you're running, and $PSVersionTable.PSEdition says Core in PowerShell 7 and Desktop in Windows PowerShell.

You search for how to do something, and the first answer says "open PowerShell". The next says "open Windows PowerShell", a third says "run pwsh", and a fourth says "in your terminal". Are these four different things? Two of them are the same, and the others fit together like the parts of a food truck. Once you can tell them apart, you'll know which window a tutorial means, and why a command works in one and not in another.

The window, the program and the prompt

Picture that food truck. You stand at the window and say your order. Inside, a cook reads it and makes it. When your food is handed over, the cook calls "Next!", ready for another order.

A terminal works the same way:

  • The terminal is the window: it shows what you type and what comes back. On Windows 11 it's Windows Terminal.
  • The shell is the cook: the program that reads your command and carries it out. In this course, that's PowerShell.
  • The prompt is "Next!": the text the shell shows when it's ready for another command.

Read the prompt from left to right. In PS C:\Users\Sam>, PS means PowerShell, C:\Users\Sam is the folder it's working in, and > means "your turn".

One window can hold more than one cook. Click the down arrow beside the + in Windows Terminal, and it lists every shell it knows, each opening in a tab of its own:

Windows Terminal's new-tab menu open, listing PowerShell, Windows PowerShell, Command Prompt and the other shells it found

Two PowerShells

That list has two PowerShells, and that's the part that confuses people. Here's the difference:

Windows PowerShell PowerShell
Version 5.1 7 (7.6 in this course)
Where it comes from Built into Windows You install it, as in the setup lesson
Its program powershell.exe pwsh.exe
Runs on Windows only Windows, Mac and Linux
New features No: it only gets fixes Yes

Why are there two? In 2016, Microsoft rebuilt PowerShell so it could run on a Mac and on Linux too, and made its code open for anyone to read. The rebuilt version couldn't run every old script exactly as before, so Windows still includes Windows PowerShell 5.1 for those scripts, and the new one got a new program name, pwsh. On older Windows, and on many work PCs, Windows PowerShell opens in a blue window. Inside Windows Terminal both look alike, so don't trust the color: ask.

Which one am I in?

$PSVersionTable.PSVersion asks the shell for its version. In PowerShell 7:

$PSVersionTable.PSVersion
Major  Minor  Patch  PreReleaseLabel BuildLabel
-----  -----  -----  --------------- ----------
7      6      9

The same command in a Windows PowerShell tab answers with a 5 and a 1, and two numbers that belong to your copy of Windows:

Major  Minor  Build  Revision
-----  -----  -----  --------
5      1      26100  9711

$PSVersionTable.PSEdition gives a one-word answer: Core in PowerShell 7, and Desktop in Windows PowerShell.

$PSVersionTable.PSEdition
Core

On a Mac or Linux there's only PowerShell 7: pwsh starts it, and its prompt shows a path with /, such as PS /Users/sam>.

Which one does a tutorial mean?

Look for clues in the words:

  • Windows PowerShell, powershell.exe, or PowerShell ISE (an old editor that came with it): the tutorial means 5.1.
  • PowerShell 7, pwsh, or steps for a Mac or Linux: it means 7.
  • Only "PowerShell": usually either works.

Most commands work the same in both, so a tutorial for 5.1 almost always works in PowerShell 7. Where they differ, this course gives a one-line note, so a learner on a work PC with only Windows PowerShell isn't stuck.

Check yourself

2 questions to try on the lesson page.

So what

When a tutorial says "open PowerShell", you now know which window to open, which shell is in it, and how to ask it which version it is.

Key terms

Cheat sheets

Related