Windows PowerShell, as its name suggests, is a powerful automated task framework from Microsoft. The tool, which debuted alongside Windows 7, includes more than 130 standard command-line tools for functions and enables administrators to perform tasks on local and remote Windows systems. It may be more complicated, but PowerShell's functionality is far more advanced than Microsoft's previous command-line interfaces (CLIs). These began with command.com, which was the interpreter for MS-DOS and the shell in Windows 9x systems. Microsoft superseded this in Windows NT with CMD.exe, which added features like better error messages, command line completion, and native access to the command history. PowerShell began as a project called the Microsoft Shell (AKA Monad) in 2002, but it wasn't until 2006 that the company renamed it and integrated it into Windows 7. Since then, PowerShell has been an integrated component in the Windows OS. Although CMD.exe coexists with PowerShell, its influence is gradually eroding. Microsoft officially replaced it with PowerShell as the default command shell accessible from File Explorer in November 2017. So why the shift to PowerShell? CMD.exe was a limited tool. You could use it to run basic administrative commands on a machine, but you couldn't manage 400 at once, nor could you manage things remotely, such as virtual servers in the cloud.

Though CMD.exe doesn't do those things, PowerShell supports add-on functionality to manage machines in Microsoft's Azure cloud, such as creating, controlling, and monitoring virtual machines, and configuring cloud storage. Jeffrey Snover, the head of the PowerShell project team, designed the tool as the missing link between Microsoft's GUI-based administrative tools and the rich set of application programming interfaces (APIs) that expose the company's .NET framework. He wanted a single command-line tool to support both developers and administrators. In this sense, PowerShell was one of the first forays into what became DevOps, a practice that promotes collaboration between developers and operations teams. What can PowerShell do? Unlike CMD.exe, PowerShell is an object-oriented tool. Objects are representations of items like files and directories that have their own properties and actions that you can call upon in the CLI. PowerShell understands everything in Windows as an object but also lets you create your own object types. PowerShell enables admins to get at these objects using more sophisticated commands than you'll find in CMD.exe. One of the tool's key innovations is its use of commandlets (CMDlets). These are small programmes (as little as a dozen lines of code) that can carry out specific tasks using .NET's APIs. They can execute an object's methods, query and change its attributes, and return objects as their results. CMDlets come in a simple verb-noun form and enable you to get things done quickly. For example, typing Get-Member gives you information about an object, like its properties or attributes. Get-Member won't do much on its own, though. You need a pipeline, another thing that wasn't available in CMD.exe. Unix and Linux users have enjoyed pipelines for decades, and it's just one command that PowerShell supports from the Bash shell that's common to those systems. A pipeline lets you take the output of one command and 'pipe' it to another, which takes it as input. You depict a pipeline using |. Say you want to create an object in PowerShell: