What is PowerShell?

PowerShell can be a little overwhelming to understand when you first meet it, but ultimately it's just a fancy interface. PowerShell interfaces with providers, which allow for access to functionality that isn't easily leveraged at the command line. In a way, they're like hardware drivers: code that provides a way for software and hardware to communicate. Providers allow us to communicate with functionality and components of Windows from the command-line.

When I described PowerShell as a task automation and configuration management framework, that's more along the lines of Microsoft's definition of PowerShell. As hackers, we think of what things can do, not necessarily how their creators defined them; in that sense, PowerShell is the Windows command line on steroids. It can do anything you're used to doing in the standard Windows command shell. For example, fire up PowerShell and try a good old-fashioned ipconfig as shown in the following screenshot:

Works just fine. Now that we know what PowerShell allows us to keep doing, let's take a look at what makes it special.

For one, the standard Windows CMD is purely a Microsoft creation. Sure, the concept of a command shell isn't unique to Windows, but how it's implemented is unique as Windows has always done things its own way. PowerShell, on the other hand, takes some of the best ideas from other shells and languages and brings them together. Have you ever spent a lot of time in Linux, and then accidentally typed ls instead of dir inside the Windows command line? What happens in PowerShell? Let's see:

That's right—the ls command works in PowerShell, alongside the old-school dir and PowerShell's own Get-ChildItem.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.153.38