PowerShell Replaces Command Prompt
Written by Mike James   
Monday, 21 November 2016

Microsoft has replaced the long standing command prompt with PowerShell, which puts .NET at the top of the agenda even though it isn't as loved elsewhere in Windows.

 

powershelllogo

Windows has long had a problem with its command prompt because the language it implemented was weak, to say the least. You could do things with it if you really tried but, compared to almost any shell program under Linux or Unix, it really didn't have the features needed to make it powerful and easy to use. The most obvious thing to do would have been to improve it incrementally - a better for loop, a full conditional and better expression evaluation say. This isn't what Microsoft did however. Instead, about ten years ago, they introduced PowerShell, which could be considered overkill. 

PowerShell is a complete object-oriented shell based on .NET. The programmer can write scripts that make use of .NET objects, both their methods and ad their properties. This makes PowerShell very powerful, but it also makes is potentially as complicated as full .NET programming, perhaps more so because scripting in it is mostly using objects that other programmers have created. It also can make use of COM and WMI, which are also complex systems in their own right. You could say that whereas the command prompt was reduced and simple to the point where it was unusable, PowerShell was too complex for casual use. 

With the release of Windows 10 build 14971, Microsoft has decided to make PowerShell the default, replacing the long familiar command prompt aka the last trace of MS-DOS still in Windows:

"PowerShell in the Shell: In an effort to bring the best command line experiences to the forefront for all power users, PowerShell is now the defacto command shell from File Explorer. It replaces Command Prompt (aka, “cmd.exe”) in the WIN + X menu, in File Explorer’s File menu, and in the context menu that appears when you shift-right-click the whitespace in File Explorer. Typing “cmd” (or “powershell”) in File Explorer’s address bar will remain a quick way to launch the command shell at that location. For those who prefer to use Command Prompt, you can opt out of the WIN + X change by opening Settings > Personalization > Taskbar, and turning “Replace Command Prompt with Windows PowerShell in the menu when I right-click the Start button or press Windows key+X” to “Off”."

At the moment there is a switch in the control panel that will put things back as they were, but this move to PowerShell might become even more permanent in the future. In most cases this won't matter much in that PowerShell supports most of the common MS-DOS commands and as a bonus there are aliases for most common Linux/Unix commands. 

PowerShell was open sourced earlier in the year and extended to work on OS X, CentOS and Ubuntu. 

It is difficult to know what impact the move will have in the wider world. Help desks are going to have to modify their scripts once they get past "switch the machine off and on" to make use of PowerShell and less technical users might be confused by the change, but overall it doesn't seem like a bad move. 

powershelllogo

More Information

Announcing Windows 10 Insider Preview Build 14971 for PC

Related Articles

Microsoft Open Sources PowerShell And It Runs On Linux 

PowerShell for SQL Server Essentials 

Run Linux Binaries On Windows 10 

PowerShell 3 preview 

 

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on, Twitter, FacebookGoogle+ or Linkedin

 

Banner


Prompt Engineering Techniques To Make You An Expert
18/11/2024

Introducing a GitHub repository full of hot tips and instructions on how to build the perfect prompt presented in a collection of Jupiter Notebooks.



Flutter Forked As Flock
05/11/2024

One of developers who worked on the Flutter team at Google has created an open-source form of the framework. Matt Carroll says Flock will be "Flutter+", will remain constantly up to date with Flutter, [ ... ]


More News

 

espbook

 

Comments




or email your comment to: comments@i-programmer.info

Last Updated ( Tuesday, 09 October 2018 )