Welcome to the Windows PowerShell Primer - a web site created with two objectives in mind.  Firstly, it's intended to provide a handy reference guide, covering the whys and wherefores of PowerShell, it's syntax and coding constructs.  The guide includes numerous working examples with clear explanations and "from the field" hints and tips.  Secondly, it's intended to provide a dip-in-and-out task-orientated resource, where system administrators can grab one-liners, or entire scripts, to assist in their daily working lives.

So how did this primer come about?  Well, since PowerShell's debut in 2006, its prominence and importance has [very] quietly increased, bringing us to the present day with Windows Server 2016, where PowerShell takes centre stage.   This transition is no accident.  In 2015, under the leadership of Satya Nadella, Jeffrey Snover was appointed as the lead architect of Microsoft's Enterprise Cloud Group, responsible for Microsoft's cloud offering (Azure), Windows Server and System Center.   Jeffrey Snover is the inventor of Windows PowerShell, and is a firm believer in the tenet that server operating systems should not have graphical user interfaces (GUIs).

It is for this reason that Windows Server 2016 does not have a graphical interface by default (the Server Graphical Shell is an optional post-installation Windows Feature).   Microsoft's intention is that Windows Server 2016 should be remotely managed, using remote server administration tools (RSATs), Windows PowerShell (via its capabilities) and Desired State Configuration.   So, as a minimum, the future of Windows systems administration necessitates a familiarity with PowerShell as a command-line server management tool.  This primer will hopefully assist in bridging the knowledge and experience gap for those Windows Systems Administrators that don't have a command-line orientated background.

PowerShell is Microsoft's next-generation interactive shell, scripting language and configuration and management subsystem, and has been designed and written from the ground-up to replace the legacy Windows shell, associated shell scripts and the Visual Basic scripting language (VBScript).   PowerShell is built directly on Microsoft's .NET Framework - a hardware independent tokenised framework used by all versions of Microsoft Windows.  PowerShell versions are therefore closely tied to the versioning of the .NET Framework, for example, PowerShell V3.0 requires .NET V4.0 and PowerShell V4.0 requires .NET V4.5.

PowerShell can interact with all of the existing 32-bit or 64-bit command-line binaries, for example: icacls.exe, ipconfig.exe, netsh.exe, nltest.exe, wmic.exe, Etc.   However, the true power of PowerShell comes from its ("lightweight" commands), which make calls directly into the .NET Framework.  This direct link means that PowerShell can natively interact with the file system, registry, COM objects, JSON, REST, WMI, WS-Management, XML, Etc.  PowerShell can also be extended by means of and snap-ins, making it possible to interact with other technologies from within the PowerShell environment.  Microsoft, for example, have made PowerShell the primary means of managing the current versions of Windows Server (see above), Exchange Server and SQL Server.  Other vendors, such as Hewlett Packard Enterprise (HPE) and VMware, have also exposed their management interfaces to PowerShell.

Regardless of why you've arrived here, I'd recommend reading, or at least, reviewing chapters and .  Here, we'll familiarise ourselves with the three most important tools in the PowerShell toolbox, these being , and .

These tools enable anyone new to PowerShell to discover more of its syntax and capabilities.