Use PowerShell

The Windows Command Processor is severely outdated. It was never meant to be used as your main command line tool in Windows after Windows PowerShell replaced it as the default in Windows 10 build 14791. Yet we all seem to collectively switch back to CMD. Why?

Pitfalls of CMD

Command Prompt was originally made as a way for people to run MS-DOS programs in Windows. Windows hasn’t been DOS-based for 23 years. (31 years if you count the release of Windows NT 3.1.)

Command Prompt lacks a lot of key features modern shells have, some being:

  • History
  • Autocomplete*
  • Startup (profile) scripts
  • Consistent syntax**
  • Aliases
  • Scripting that doesn’t suck

*CMD has rudimentary autocomplete for items in your current directory, but no command autocomplete
**Some commands use /option, some use -option, and some can use both

Benefits of PowerShell

PowerShell comes along and beats all the other shells (including Bash, I’ll get into that later) and takes my #1 spot. It has all the features above that CMD doesn’t, and has a really good scripting language. On top of that, it’s built using .NET which means you can also run methods from DLLs or run your own C# code right in PowerShell, and you can generally do a lot more in PowerShell.

Bash

I think PowerShell is slightly better than Bash. However, when I’m using Linux i still use Bash over PowerShell, reason being that Bash is more lightweight and that it’s preinstalled and the standard for Linux. If PowerShell was the default on a given distro, I would probably use it assuming I didn’t need to run any Bash scripts.

PowerShell 7 (PowerShell Core)

In case you didn’t know, there are two main versions of PowerShell; Windows PowerShell, which is version 5.1 and is preinstalled on all Windows installations, and PowerShell—also known as PowerShell Core—which is version 7 and is cross-platform but not preinstalled. PowerShell refers to 7 and Windows PowerShell refers to 5.1. I would recommend anyone install PowerShell 7 from the Microsoft Store (the only program I would install from there aside from WSL) and set that as the default. It has more features and feels less outdated. Just run Get-Credential in both versions and you’ll see what I mean.

Conclusion

Everyone should switch from Command Prompt to PowerShell if they haven’t already. If you’re on Linux, install PowerShell if you want but probably continue using Bash. If you’re on MacOS, switch to Windows or Linux.


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *