I recently attended the Microsoft 10961B PowerShell training course. In the spirit of sharing, here are my top five take aways for those new to PowerShell:
Take Away 1: Learning and using PowerShell is all about command and knowledge discovery.
Three cmdlets that help us learn about PowerShell concepts, lookup commands and inspect objects:
- Get-Help – Read help information for topics and commands
- Get-Command – Find commands based on partial names / concepts
- Get-Member – Discover object properties and methods
There are approximately 24 “core” cmdlets that a seasoned PowerShell user will want to memorize. The rest can be discovered on-demand. No need for memorizing thousands of commands.
Take Away 2: Most day-to-day tasks are generally performed on the command line, not by running complex scripts.
Scripting is powerful and useful but it probably makes sense to focus on using PowerShell as a shell first and transitioning to scripting once we want to do more advanced things.
The Microsoft terminal for hosting cmd.exe and powershell.exe is… not so great. Alternative terminal programs to host the PowerShell engine are available. I prefer ConEmu. Install it locally or on a terminal server “jumpbox” and use PS Remoting!
Take Away 3: Everything is an object.
Output of cmdlets are objects that can be fed into other cmdlets to form powerful pipelines of processing. Unlike traditional UNIX/Linux shells, PowerShell commands return objects, not text. While text parsing can be used in PowerShell, most use cases do not require it as there is often a simpler, more direct way of accomplishing the same thing using object properties or methods.
Take Away 4: Remoting is powerful!
Enabled by default on Server 2012 and newer. Uses a single port. Secure. Allows for one-to-one or one-to-many management of remote systems. PS Remoting is a great alternative to logging into remote servers with RDP to perform manual GUI tasks.
It’s almost like SSH in UNIX/Linux, but flavoured for Microsoft Windows.
Take Away 5: PowerShell is the current and future best practice for managing Microsoft Windows.
With the release of Windows 8 / Server 2012 (PS 3.0 and newer), Microsoft has provided over 1500 cmdlets to manage their flagship operating systems. It is clear that PowerShell is how Microsoft intends to move management of Windows forward from here on out.
Summary
Start learning PowerShell today to stay current with modern practices for management and administration of Microsoft products!