What is The Difference About Command Prompt and PowerShell on Windows

Table of Contents

What is a Command Prompt

Command Prompt or cmd is a Windows program that can be found on all versions of Windows PC.

The Windows command prompt was the only shell for the Microsoft DOS operating system until Windows 10 build 14791, but now Windows has introduced a new shell supported for Windows called PowerShell.Now, Windows introduced PowerShell 7.0 with new features.

Command Prompt or cmd is used to run a command line script or tasks related to operation on Windows.

If you want to find the command prompt, you can write cmd.exe on the search menu bar in the Start Menu.


What is PowerShell

PowerShell has more features than a command prompt. Or you can say that PowerShell is a command prompt extended.

PowerShell is quite similar to cmd. PowerShell is not just a shell, but a scripting environment designed to perform administrative tasks on multiple operating systems.

PowerShell is a task-based command-line tool and scripting language built on the .Net framework which enables administration and invokes sets of commands within the context of automation scripts called cmdlets.

The Difference between PowerShell and Command Prompt

The Difference between PowerShell and Command Prompt (CMD)

Some of the commands on PowerShell are the same as to command prompt, like ping, and ipconfig, which all work. But some commands change from command prompt to PowerShell.

These are a few commands that Command Prompt and PowerShell are different.

  1. DOS: cd
    PowerShell: Set-Location
    Description: Change a Directory
  2. DOS: del
    PowerShell: Remove-Item
    Description: Delete a File
  3. DOS: dir
    PowerShell: Get-ChildItem
    Description: To List Files in a Directory
Alias Command PowerShell
Note:
You can see if a DOS command has an alias, by using the Get-Alias command in PowerShell. For example, typing Get-Alias dir shows you that dir is running the Get-ChildItem cmdlet.

The real purpose of PowerShell is to run system administration tasks, especially for managing the registry to WMI (Windows Management Instrumentation) which Windows Command Prompt cannot do.

PowerShell makes use of pipes, just like Linux does. The pipes allow you to pass the output of one cmdlet to the input of another cmdlet.