Windows Devs Prefer PowerShell as CLI
The Windows Dev Docs team on Twitter recently posted an informal poll asking, "Well? What's your go-to command line?" with choices being the cmd Windows command prompt, PowerShell, WSL Bash and Azure Cloud Shell.
With 314 votes, the results are in: it's PowerShell, with 45.2 percent of the votes, followed by cmd (37.6 percent), WSL Bash (15.6 percent) and Azure Cloud Shell (1.6 percent).
Here are some developer comments about the issue:
- Opening WindowsTerminal in Administrator mode with Powershell, CMD, Bash and CloudShell 😎✅🚀🤘
- cmd as powershell is getting slower and slower and bash WSL
- honestly cmd; Like I'd like to say PowerShell but I've been using cmd for support stuff since like the 90s
- It's always cmd. Even changed the defaults.
- It really depends on what I'm planning to do. That's why Windows Terminal has a right-click menu when you pin it.
So one might wonder what's up with Azure Cloud Shell (different from Azure CLI), which apparently was the favorite choice of only five developers. It's not like it's old, having debuted way back in 2017. Interestingly, Microsoft documentation says it just lets developers use one of two other survey options: "Azure Cloud Shell is an interactive, authenticated, browser-accessible shell for managing Azure resources. It provides the flexibility of choosing the shell experience that best suits the way you work, either Bash or PowerShell."
In fact, in accessing Azure Cloud Shell via direct link, a user must immediately choose one or the other, as depicted above.
Which to choose? The MSP360 site explains the differences in an article titled, "Azure CLI vs PowerShell: What Is the Difference?"
"PowerShell is a command shell and associated scripting language for the majority of Windows operating systems," the article says. "Bash is a Unix shell and scripting language for most Linux operating systems. The first version of PowerShell was introduced in 2006. The Bash shell appeared in 1989. PowerShell treats input and output as objects, while Bash always accepts input and output as text structures. The user interface of PowerShell is a command-line interface; that of Bash is a text command-line interface. PowerShell can be used on any version of Windows from Windows 97 onward. Bash is mainly used with Linux and Unix operating systems. PowerShell is a scripting language based on the .NET framework and C# programming language, while Bash is a scripting language based on the C programming language."
For more information, the LinuxConfig site earlier this year published an article titled, "Bash scripting vs PowerShell" in which is the handy comparison table above.
"What it boils down to is that Bash is great for administration and automation on Linux, and PowerShell fills that same gap but on Windows systems," the article concludes. "They both have some crossover, yet are at their peak on their native systems."
David Ramel is an editor and writer for Converge360.