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 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.