Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What problem did MS solve by creating PowerShell? [closed]

Tags:

powershell

I'm asking because PowerShell confuses me.

I've been trying to write some deployment scripts using PowerShell and I've been less than enthused by the result. I have a co-worker who loves PowerShell and defends it at every turn. Said co-worker claims PowerShell was never written to be a strong shell, but instead was written to:

a) Allow you to peek and poke at .NET assemblies on the command-line (why is this a reason for PowerShell to exist?)

b) To be hosted in .NET applications for automation, similar to DCOP in KDE and how Gnome is using CORBA.

c) to be treated as ".NET script" rather than as an actual shell (related to b).

I've always felt like Windows was missing a decent way to bang out automation scripts. cmd is too simplistic in many cases, and WSH is too obtuse (although the combination can be used successfully, I'm not a fan). When I first heard about PowerShell I felt like Windows was finally getting a decent shell that would be able to help with automation of many tasks, but recent experiences, and my co-worker, tell me otherwise.

To be clear, I don't take issue with the fact that it's built on .NET, or that it passes objects around rather than text (despite my Unix background :]), and I'm not arguing that PowerShell is useless, but from what I can see, it doesn't solve the problem I was hoping it would solve very well. As soon as you step outside of the .NET/Powershell world, things quit being nice and cozy for you.

So with all that out of the way, what problem did MS solve by creating PowerShell, or is it some political bastard child as I suspect? I've googled and haven't hit upon anything that sufficiently answered that for me, but the more citations the better.

like image 526
Fred Avatar asked Jun 09 '09 00:06

Fred


People also ask

Why did Microsoft create PowerShell?

What is PowerShell? Released as PowerShell 1.0 on Nov. 14, 2006, Microsoft developed PowerShell to address the shortcomings of its DOS-based CLI, particularly when managing objects using complex scripting languages.

What is the purpose of Windows PowerShell?

Windows PowerShell is a powerful tool for automating tasks and simplifying configuration and can be used to automate almost any task in the Windows ecosystem, including active directory and exchange. It's no wonder that it's become a popular tool among sysadmins and experienced Windows users.

What is PowerShell and what would you use it for?

Windows PowerShell is a Microsoft framework for automating tasks using a command-line shell and an associated scripting language. When it was released in 2006, this powerful tool essentially replaced Command Prompt as the default way to automate batch processes and create customized system management tools.

Why does Windows PowerShell keep popping up and closing?

This PowerShell error might be caused by some corrupted third-party apps on your device. Now, the best solution here is to perform a clean boot. From there, you can remove any suspicious app.


1 Answers

PowerShell was actually built as several things: A mature and extensible automation platform and a modern administration shell.

The former is primarily used for the administration GUIs for Exchange and other server products of recent times. The GUI is just a wrapper around PowerShell which does the heavy lifting behind (kind of like UNIX GUI programs come to be, as a wrapper for a commandline program).

Jeffrey Snover (PowerShell inventor) elaborates a little on how PowerShell was created with which goals and problems it should solve.

In my opinion, PowerShell as a shell is clearly intended as a replacement for cmd (easy to see) and Windows Script Host (Windows Script Host didn't get much attention in recent years, even though it had similar concepts as .NET back in its day [one platform, multiple languages with ActiveScripting], but with .NET Microsoft basically put that to rest and resurrection probably wasn't an option for them).

It unifies most aspects of Windows administration in common concepts and methods you only have to learn once. Also, the power in PowerShell for me stems greatly from it passing around objects which might explain why you get into problems when you step out of the .NET/PowerShell world where you only get a String[] from a command. But for many things you would call an external program for in cmd, there is a cmdlet which will do it for you.

like image 121
Joey Avatar answered Sep 23 '22 14:09

Joey