I’ve been hearing a lot about PowerShell recently, and was wondering whether there’s any reason to use PowerShell instead of (for example) a console application or Windows service using WMI behind the scenes.
What are the benefits and advantages of PowerShell? What is it for?
PowerShell can do lots of things that a .NET console application can do, but it’s still a scripting language. But it’s a heck of a lot better than the batch file language or VBScript/JScript. It’s strengths include being able to use UNIX-like pipes and filters but with objects instead of dumb text. It can also create CLR and COM objects and invoke their properties and methods.
However, if you are writing anything complex, you’d be better served writing a compiled program so you have the benefits of finding errors at compile time and having a better IDE. Also, if you want to run a PowerShell script, PowerShell must be installed on the computer where you’re running it.