Why does PowerShell make sense as a tool for cloud administration in 2020? It may not be people’s default choice, especially for automating Linux stuff. But here’s why PowerShell is worth consideration — and, more than that, why it just might be the best option out there.
The Rise of an Unlikely Automation Hero
Cloud growth leading up to 2020 was already tremendous. You’d be hard-pressed to find an organization that wasn’t moving some part of their infrastructure to the cloud, if not converting it fully. With the onset of COVID, what was already a race to the cloud became a full-on sprint. Businesses suddenly had an instant need to scale their websites, enable remote work, and provide contactless means of bringing value to their customers. There’s no better way to achieve quick and scalable services than through the cloud, and so more than ever people are taking advantage of its potential.
With all of this new and existing cloud utilization there comes a great need to have a solid automation strategy. It quickly becomes very difficult to maintain the pace and flexibility needed to remain competitive if you’re managing all of your cloud resources manually. But what tool do you use to manage all of these resources, especially if you have them spread across multiple clouds or data centers?
An unlikely hero enters the scene: PowerShell.
This might come as a surprise, especially given that there are already a lot of great and popular tools out there like Python. What makes PowerShell worth consideration, much less the “best” option?
Lend me your ear and I’d like to tell you about this oft-overlooked black sheep from Microsoft. Here are five reasons you should consider using PowerShell for cloud management.
1. Cross-Platform Installation
You can use PowerShell from the machine of your choice.
While PowerShell made its debut under Microsoft, modern versions are cross-platform. Many to this day still think of it as being a strictly Windows tool. But in fact, with the release of PowerShell 7, it’s even open-source. Microsoft has really changed their tune the last several years, embracing the open-source and Linux community, and PowerShell seems to be a key part of that.
This is great news for both developers and systems administrators because it means you can use this powerful automation tool from the machine of your choice. So long as you have a web browser, you don’t even have to install PowerShell at all. Microsoft Azure has integrated it directly into their portal, allowing you to utilize Azure Cloud Shell straight from your browser.
Showing even more of a commitment to Linux and open-source, this tool utilizes Ubuntu machines in the background to provide you with a shell experience that’s not only globally accessible but persists between sessions.
2. Object of My Affection
A key differentiating feature of PowerShell is its ability to work with objects instead of simply text.
For example, if I run Get-Process it will return for me a list of running processes. At first glance, this looks the same as any other text list from any other tool. But the surprise here is that it’s actually a list of objects. I can reference individual properties of that object and even use them selectively in piping to other commands. This simple difference has a significant impact when writing scripts or working with commands on the fly, so much so that this feature alone is an attractive draw for users of other tools.
3. By Your Powers Combined
PowerShell modules let you upgrade your abilities.
Another great feature of PowerShell is modules. Basically, these are add-ons that you can easily import into your session to instantly upgrade your abilities — kind of like Neo in his Matrix training chair.
Not only does this allow you to work with a variety of products (such as Active Directory, SQL Server, and AWS or GCP resources), but it allows you to do it at the same time. That means you can have one script that’s managing local AD permissions, pulling queries from a database, and provisioning cloud resources. The possibilities are really limitless and entirely customizable by you.
4. It Just Makes Sense
PowerShell’s language is intuitive and repeatable.
Sometimes when we’re debating technical choices, we can get lost in the weeds of feature comparisons, syntax nuances, and rivalries. We forget in the end that we’re humans who need to get a job done and that the simplicity of the language can have a dramatic effect on our daily work life, either for better or worse.
In my opinion, this is one area where PowerShell shines. Don’t know much about PowerShell? No worries. Getting started with PowerShell is easy. The entire structure of the language has been thought out in a way that is intuitive and repeatable. All commands are built in a verb-noun format. So you say the action you want to take, and what you want to take action on.
As mentioned earlier, to get processes I run Get-Process. If I want to get a list of commands I use Get-Command. If I want to add a user to an existing Azure AD group I use Add-AzADGroupMember. You get the picture.
Not only does this help with remembering commands that you use frequently, but after a short time you can practically guess what the command will be — even if you’ve never used it before. And because of the consistency across modules, you can often guess the parameters that go with it as well. This is especially helpful for those new to the language or to automation in general.
5. PowerShell is Freaking Cool
One last very technical point: PowerShell is just a lot of fun.
I encountered PowerShell very early in my career after coming off a project where I had to maintain a legacy VBScript file (shudder). After that painful experience, stepping into PowerShell (then in its infancy) was like a cool drink of water. I couldn’t believe how easy it was to accomplish powerful tasks, and it’s only gotten better with time. Since then, I’ve had the chance to use it in a variety of scripts and every-day administration tasks, write my own module, and implement it across multiple operating systems and environments. It’s been a wild ride that I’ve thoroughly enjoyed, and it only gets more fun as I go.
Here’s the quick and dirty of why PowerShell is so fantastic.
- PowerShell is a scripting language and shell that you can run from any machine (even one that doesn’t have it installed, via Cloud Shell).
- It can manage both Windows and Linux machines.
- PowerShell lets you manage cloud resources across Azure, AWS, and GCP.
- And PowerShell lets you do all of this in a simple but powerful way. Throw it all into an Azure PowerShell Runbook and you have a repeatable way for coworkers to accomplish these tasks as well.
Don’t let the fact that it’s made my Microsoft fool you, and don’t be held back by common misconceptions about it. Get to know the new PowerShell for yourself and I think you’ll enjoy it as I have.
Power Up Your PowerShell Game with ACG
Looking to learn more about PowerShell? Check out some of A Cloud Guru’s other PowerShell courses.
- PowerShell Core for Linux Admins — This intermediate-level, 8-hour course is one of ACG’s free courses for the month of November.
- Getting Started With PowerShell — This mini-course will take you from the ground up installing, using, and scripting in PowerShell.
- Azure PowerShell Essentials — This beginner-level course covers the essentials of using PowerShell and the Azure PowerShell module.
- Cross-Platform PowerShell in Azure — Get familiar with running PowerShell on Linux in this 12-hour course.