What is PowerShell?
I have Windows 7 installed, and I noticed that it has PowerShell. I remember installing this a while back when signing up for Windows Azure, but only
PowerShell is Bash with more annoying syntax.
Windows PowerShell is a task automation and configuration management framework from Microsoft.
It's having extendable command shell and scripting language which can be used to manage or administer server environments like Windows Server, Exchange and also SharePoint 2010.
Here's one of the cool effects of the .NET integration / object hangling: calling webservices from the command line and handling the results as .NET objects that can be manipulated.
The value of PowerShell is less a benefit for end-users, and much more a benefit for system maintainers, because they know it will be installed on every machine that has Windows 7 or later.
PowerShell is a new command shell and scripting language for Windows. It is cool for a lot of reasons:
The language is sane, especially when compared to CMD.
Scripts and command line share a language. CMD had many small but important differences. CScript and Windows Scripting Host are not interpreted.
Command line usage can be quick while scripts can be readable, thanks to the combination of aliases and smart command argument processing. For example, dir -r .
is the same as Get-ChildItem -Recurse -Path "."
Consistent command argument syntax, across all cmdlets and custom scripts (in V2.0).
Powerful interaction with other technologies, most notably .NET. Also, WMI is suddenly convenient and accessible. COM is there, too. V2 makes Win32 interop easy, too.
An integrated script editor/interactive shell in V2 that is very cool.
Command pipelines work on objects, not strings, which means you don't need to parse, and you can format text for humans not the next command. In bash I did a lot of cut
, but in PowerShell I don't have to. The objects are real .NET objects, which is very powerful.
Before PowerShell I managed to become an expert in CMD script writing, but now I can start erasing that part of my brain. Thank goodness.
EDIT: It's worth mentioning that lots of Microsoft products are adding PowerShell support, especially for server products. For example, Exchange ships with PowerShell cmdlets, so you can administer your Exchange server via PowerShell.
In my opinion, the big deal is PowerShell passes around objects. It takes a while to realize just how powerful this is. For example, instead of munging the text output of a utility, looking for what you want in characters 7 through 18, you can just access a property of an object. That's much faster to use, and it's not going to break if a new version adds an extra character to the output.