PowerShell is an extremely important tool in an IT professional’s arsenal, right next to the rattling box of screwdrivers and pile of vendor swag you got from IT conferences. If you aren’t familiar with PowerShell, let us introduce you! According to Microsoft, PowerShell is a cross-platform task automation solution made up of a command-line shell, a scripting language, and a configuration management framework. The PowerShell shell includes a robust command-line history, tab completion and command prediction, command and parameter aliases, pipeline for chaining commands, and an in-console help system.
Now, when just getting started with PowerShell, the important part of that definition is “task automation solution.” As a robust scripting language, PowerShell allows you to schedule repetitive, tedious tasks so that you can focus on the task that need more of your undivided attention.
(If you’re looking to learn more about the history of PowerShell development, this article from Adam the Automator is a great place to start: https://adamtheautomator.com/what-is-powershell/)
The power of PowerShell
Knowing the history and definition of PowerShell is great, but how can it actually make an impact in your day-to-day operations?
Simple, yet impactful, automation opportunities
PowerShell has binary commands that can be used to perform simple actions, and a vast number of these compiled binaries called cmdlets are included. These cmdlets can serve as the building blocks for your code, as there are a number of actions working behind the scenes. Cmdlets can be used separately but also combined into more complex workflows. And once you get more accustomed to writing PowerShell scripts, you can even delve into functions, which are scripts written in PowerShell and increase your code’s effectiveness by making it easier to read and use.
These two examples are just scratch the surface on a number of PowerShell actions that can be used to improve automation capacity. Any small, daily tasks can often be automated, and that saved time can add up.
Increased visibility into your network
Using PowerShell, you can quickly access data across your organization that may not be as easily accessible with other methods. Cmdlets can be used to pull desktop settings like BIOS info, processor info, computer manufacturer and model, OS version, and more. Or it can be used to automate alerts based on a variety of different conditions, enabling your IT team to be more proactive when it comes to device management.
With the Get-Command cmdlet, you can easily gather a list of commands that can be used on a given device, including cmdlets and functions.
PowerShell is an incredibly versatile coding language
Many IT professionals find PowerShell to be invaluable in daily operations, using it in everything from file transfers to automated deployments. And it can be one of the more approachable coding languages as well, thanks in part to the verb-noun syntax used for cmdlets. The verb part of the name will identify the name of the action that the cmdlet performs while the noun part of the name identifies the entity on which the action is performed.
So, if we look at Get-Command above, this cmdlet will “get” all of the “commands” that are registered in PowerShell. There are specific naming recommendations to follow based on approved verbs, which can be found here: https://learn.microsoft.com/en-us/powershell/scripting/developer/cmdlet/approved-verbs-for-windows-powershell-commands?view=powershell-7.3
With easily accessible flexibility, PowerShell can be used across the board for a nearly unlimited number of use cases.
How to learn PowerShell
We’ve talked a lot about why PowerShell may be important, but in the vast sea of PowerShell resources, it can be difficult to know exactly where to start. We’ve compiled a list of resources below that may be helpful, ranging from beginner to expert.
We also worked with Adam the Automator to develop a 30-minute crash course in PowerShell called “PowerShell for IT Ninjas” where he outlines some of the basic terminology you may encounter as well as some real-world applications that you can put to good use in your own network. You can also check out our PowerShell commands cheat sheet to learn some essential PowerShell commands.
Additional Resources
General
- Adam the Automator
- PowerShell Team Blog
- PowerShell Engineer YouTube
- Under the Wire (scenario practice)
- What’s New in PowerShell
- r/usefulscripts
- r/PowerShell
- NinjaOne Script Hub
Beginner
- Microsoft Modules (PowerShell Beginner)
- PowerShell for Beginners Full Course (posted in 2021)
- Learn PowerShell in Less Than 2 Hours (posted in 2022)
- PowerShell 101 (uses PowerShell version 5.1)
- Powershell Version