⭐ 0🔥 0🏆 0 pts

Which Windows shell should a beginner learn: PowerShell or CMD?

The terminal · 14 November 2026 · 7 min read

PowerShell vs CMD, explained for beginners: what each Windows shell is, how to tell which one you are in, why pasted commands fail, and which one to learn first.

The short answer

Learn PowerShell. It ships with Windows, so there is nothing to install. It understands the everyday names that CMD users know, such as dir, cd, copy and del, and it adds its own, more capable commands on top. Microsoft itself recommends PowerShell over the older Windows commands for automating Windows.

Then know that CMD exists. Older guides and some install pages are written for it, and pasting one shell’s command into the other is an easy way to get stuck on day one. Below: what each shell is, why there are two kinds of PowerShell, how to tell which one you are in, and a pretend terminal to try the commands safely.

The older shell: Command Prompt (CMD)

A shell is the program that reads your command and gets the computer to carry it out. Microsoft’s command reference says Windows has two of them: the Command shell and PowerShell. The Command shell is better known as CMD or Command Prompt, and its program file is cmd.exe. Microsoft describes it as the first shell built into Windows for automating routine jobs, using batch files: small scripts whose names end in .bat.

CMD is still part of Windows, and it still does the basics well: listing folders, copying files, running programs. What it cannot do is run PowerShell’s own commands. It also has its own way of writing options, with a forward slash. For example, del /p notes.txt asks for a yes or no before deleting each file.

The newer shell, in two editions

Microsoft says PowerShell can run Windows commands too, plus its own commands, called cmdlets. Cmdlets have long, readable names such as Get-ChildItem, Copy-Item and Remove-Item: a verb, a dash, then the thing it works on. For everyday jobs PowerShell also answers to short nicknames, called aliases, so dir, cd, copy and del work much as they do in CMD.

Here is the part many comparison pages skip. Microsoft makes two products with almost the same name, and they are not the same thing:

So "PowerShell is cross-platform" is true of PowerShell 7 (and version 6 before it), not of the copy built into Windows. Even in PowerShell 7, some nicknames exist only on Windows: on a Mac or Linux, ls runs the system’s own ls rather than PowerShell’s. For a beginner on Windows, the built-in Windows PowerShell is plenty. The commands DayOneCode teaches work in both editions, with one difference to know: in Windows PowerShell 5.1, > saves text as UTF-16, which some tools (Git reading a .gitignore, for one) cannot read, while PowerShell 7 saves UTF-8. You can add PowerShell 7 later if you want it.

The window is not the shell

A third name adds to the muddle: Windows Terminal. Microsoft describes it as a modern host application for command-line shells such as Command Prompt, PowerShell and bash. It is the window, with tabs, panes, colours and themes. The shell is the program running inside each tab or pane.

DayOneCode says that using a terminal is like talking to the waiter instead of pointing at the menu. In that picture, CMD and PowerShell are two waiters who speak slightly different dialects, and Windows Terminal is the dining room they work in. It can hold many tables, but it never takes an order itself. One tab can run Windows PowerShell while the next runs Command Prompt, so "I opened Terminal" does not tell you which shell you are talking to. If the whole idea of a terminal is new, start with What is a terminal?.

Same jobs in both shells

For everyday file work the two dialects are close. Microsoft says the nicknames are there so that people used to CMD, or to Unix shells like the ones on Mac and Linux, can keep using names they already know.

JobCMDPowerShell short namePowerShell full name
List a folderdirdir or lsGet-ChildItem
Go into a foldercd Documentscd DocumentsSet-Location
Make a foldermkdir gamesmkdir gamesNew-Item -ItemType Directory
Show a text filetype notes.txttype or catGet-Content
Copy a filecopy a.txt b.txtcopy or cpCopy-Item
Move a filemove a.txt backupsmove or mvMove-Item
Rename a fileren a.txt b.txtrenRename-Item
Delete a filedel a.txtdel or rmRemove-Item
Check before deletingdel /p a.txt (asks yes or no)rm a.txt -WhatIf (only shows)Remove-Item -WhatIf
Clear the screenclscls or clearClear-Host

The nicknames are only skin-deep. del in PowerShell is really Remove-Item, so CMD’s slash options such as /p do not work with it. PowerShell’s options start with a dash instead. The most useful one for a beginner is -WhatIf: it shows what a command would do, and then does nothing at all.

A pretend PowerShell on a pretend disk: nothing here touches your real files. Use the CMD-style names, then ask Get-Alias what they really run.

⌨️ Practice terminal
Try:

Get-Alias is the quickest way to learn the real names. Ask it about a nickname such as dir or cp and it answers with the cmdlet behind it, such as dir -> Get-ChildItem.

Which shell am I in?

Two quick checks answer it. The first tells PowerShell from CMD; the second tells the two editions of PowerShell apart.

  1. Look at the prompt, the text just before the blinking line. PowerShell starts it with PS, as in PS C:\Users\you>. CMD shows only the folder, as in C:\Users\you>.
  2. In PowerShell, run $PSVersionTable. It answers with a small table. A PSVersion that starts with 5.1 and a PSEdition of Desktop mean Windows PowerShell, the one built into Windows. A PSVersion that starts with 7 and a PSEdition of Core mean PowerShell 7. If you are in CMD by mistake, it simply says the command is not recognised.
PowerShell
PS C:\Users\you> $PSVersionTable.PSEdition
Desktop

The practice terminal on this page always shows PS, because it pretends to be Windows PowerShell, the shell DayOneCode teaches. It does not know $PSVersionTable, so try that one on your own computer.

Why a pasted command fails

Some install pages for coding tools give a separate line for each shell, and pasting the wrong one is the classic first-day error. The install page for Claude Code, an AI coding tool, is a good example: it gives a PowerShell line that starts with irm, a different CMD line that joins its steps with &&, and the two error messages you see if you mix them up. Red text is a clue, not a disaster:

When you write your own two-step line in Windows PowerShell 5.1, Microsoft documents the long way round for &&: a semicolon, then a check of $?, which holds True when the last command worked.

PowerShell
git add .; if ($?) { git commit -m "First save" }

Which one should a beginner learn?

PowerShell, for four reasons:

  1. It is already there. Windows PowerShell ships with Windows, so there is nothing to download and no account to make.
  2. It covers CMD’s everyday jobs. The nicknames mean dir, cd, copy and del still work, and Microsoft says it runs Windows commands as well as its own.
  3. It goes further. Cmdlets, -WhatIf and Get-Alias exist only in PowerShell, and Microsoft recommends it for automating Windows.
  4. AI coding agents can use it. Claude Code’s docs say that on Windows without Git for Windows installed, it uses PowerShell to run its commands. Read What is an AI coding agent? before you set one up.

Keep CMD in your back pocket. When a guide says "open Command Prompt", or a line full of && fails in Windows PowerShell 5.1, open CMD for that one job and come back. You do not need its slash options until a guide asks for them.

That is the path DayOneCode follows, with no account and no install. Meet the terminal starts you in a practice PowerShell, and Dialects: PowerShell, CMD, Mac matches the names across all three. Then race the names in Command Racer, keep the PowerShell cheat sheet beside your real terminal, and read PowerShell for beginners next.

Try it on DayOneCode

Questions and answers

Should I learn CMD or PowerShell first?

Learn PowerShell first. It ships with Windows, it accepts the everyday CMD names such as dir, cd, copy and del, and it adds its own commands that CMD cannot run. Microsoft recommends PowerShell for automating Windows. Learn just enough about CMD to recognise it, so you can open Command Prompt when an older guide asks for it.

Can PowerShell do everything CMD can?

For everyday work, yes. Microsoft says PowerShell can run Windows commands as well as its own cmdlets, while CMD can run only Windows commands. The catch is in the details: in PowerShell, dir and del are nicknames for cmdlets, so CMD options that start with a slash, such as del /p, do not work, and Windows PowerShell 5.1 rejects &&. A line written for CMD is safest in a CMD window.

How do I know if I am in CMD or PowerShell?

Look at the prompt. PowerShell puts PS in front of the folder, as in PS C:\Users\you>, while CMD shows only the folder, as in C:\Users\you>. To see which PowerShell you have, run $PSVersionTable. Version 5.1 with the edition Desktop is the Windows PowerShell built into Windows; version 7 with the edition Core is PowerShell 7.

What is the difference between Windows PowerShell and PowerShell 7?

They are two separate products. Windows PowerShell 5.1 ships with Windows, runs only on Windows and gets no new features. PowerShell 7 is a separate, open-source download built on newer .NET. It runs on Windows, macOS and Linux, its program is called pwsh, and it installs side by side with Windows PowerShell. A beginner can start with either.

Is Windows Terminal the same as PowerShell or CMD?

No. Windows Terminal is the window, not the shell. Microsoft calls it a host application for shells such as Command Prompt, PowerShell and bash. Each tab or pane runs its own shell, so one tab can be Windows PowerShell while the next is Command Prompt. Check the prompt to see which shell a tab is running.

Why does && not work in PowerShell?

The && operator, which runs the next command only if the last one worked, arrived in PowerShell 7. Windows PowerShell 5.1, the version built into Windows, stops with an error saying the token && is not a valid statement separator. A line written for CMD belongs in Command Prompt, so open it and paste the line there. For your own commands, run the steps one at a time or use PowerShell 7.

Sources

The facts on this page were checked against these pages (14 November 2026):

More from the blog

DayOneCode is an independent learning site, not affiliated with or endorsed by Anthropic. Claude and Claude Code are trademarks of Anthropic.