PS1 – Should you learn PowerShell?
- PS1 – Should you learn PowerShell?
- Learn and use PowerShell with just three commands
- Working with the PowerShell Pipeline
- PowerShell History and Current State
- Getting setup for PowerShell Development
- Working With PowerShell Variables
- Taking Control with PowerShell Logic
- PowerShell Input & Output
- PowerShell Errors and Exceptions Handling
- PowerShell Remoting
Deciding if you should learn PowerShell
This is post one on a journey towards learning PowerShell. A commitment to learn PowerShell will not be a small investment of your time. Before diving straight in it’s worth exploring what PowerShell is capable of, who is using it, and how it compares to other languages. You can then determine if PowerShell makes sense for you in today’s technology landscape.
Lets start with the obvious question. What is PowerShell? PowerShell is a command-line shell interface made by Microsoft that enables system administrators and power users to manage computers from the command line. PowerShell is also a scripting language, built on .NET which can be used for automating administrative tasks and configuration management.
PowerShell tasks are generally performed using cmdlets (pronounced command-lət) which can perform a wide variety of actions. These cmdlets can perform something as simple as evaluating the size of a file, to spinning up hundreds of servers in the cloud.
PowerShell vs other languages
It can be useful to show what PowerShell is by first showing what it is not. To do that, lets take a look at some of the most popular programming languages today:
The commonality between these typically compiled languages is that they create something. A desktop application, a web application, a website, a game, or a mobile app. If your interest lies in creating these types of things, you should pursue these types of languages.
PowerShell is an interpreted language for doing things, typically in the context of managing a technology environment. A developer will develop an application in C#, but that application might run on a fleet of servers, or native cloud technology that an engineer deploys and manages with PowerShell.
Who uses PowerShell?
Another way to contrast is by job title. The above mentioned languages typically carry role titles such as:
- Full Stack Developer
- Front End Developer
- Web Developer
- Software Developer
- Application Developer
PowerShell is typically leveraged with jobs titles such as:
- Systems Administrator
- Network Administrator
- Systems Engineer
- Site Reliability Engineer
- Systems Development Engineer
- Cloud Architect
- Systems Architect
What’s in a Shell?
Systems and Network Admins/Engineers will often gravitate towards a particular operating system, Linux or Windows. This may be based on personal preference, or because the environment they work in leverages one over the other. The following scenario typically unfolds as a result:
- Linux → Bash → Python
- Windows → PowerShell → C#
This is changing now that Bash is available on Windows, and PowerShell is available on Linux. The lines are truly starting to blur, so lets explore these two languages.
PowerShell vs Bash
Bash is the shell primarily used in Linux. It combines a scripting language, as well as a host of native Linux tools to automate and manage Linux devices. Lets take a look at a PowerShell vs Bash comparison:
Both Bash and PowerShell rely on the concept of the pipeline. PowerShell pipes objects, passing along the output of one cmdlet as the input for another one. This means PowerShell pushes around structured data. Bash shells push around globs of text.
Strings vs Objects
There are pros and cons to these different approaches. Bash requires lots of string manipulation and parsing to get the information you’re after. While this can be cumbersome, all the tools at Bash’s disposal deal with a simple string, which is easy to pass around everywhere. PowerShell can very easily pass objects between cmdlets, allowing you to move complex data with very little effort. These objects are not always universal though, and are not as readily made accessible outside of PowerShell.
The two technologies aren’t a perfect comparison. A Bash / Python mix more closely resembles PowerShell while PowerShell can’t typically reach the capabilities that Python can achieve.
While the lines may be blurring Bash remains the de-facto standard for the majority of Linux users, while PowerShell remains the choice for Windows environments. They’re both continuing to evolve with each likely becoming better at managing both operating systems. At the end of the day, it may boil down to whether you prefer dealing with strings, or objects. I for one, prefer working with objects.
Where can you use PowerShell?
Many companies today aren’t running a single technology stack. As such, it’s beneficial to learn a skill that can assist you with multiple technologies. This is a great reason to learn PowerShell, as it’s supported on nearly every major platform today.
Why you should learn PowerShell
Now that you’ve gotten some insight into language outcomes (create vs do/manage), job titles that use PowerShell, and where PowerShell is used, you should have a pretty clear indication if PowerShell is the right choice for you.
PowerShell is a fantastically powerful language that can do great things for your environment, and your career. While your counterparts are performing manual steps, the automation capabilities of PowerShell can have you accomplishing similar tasks in a fraction of the time. It can be the difference between an initiative taking weeks vs minutes.
Manual repetitive steps are also prone to mistakes. PowerShell can test outcomes and ensure accuracy for every initiative. Better still, it’s versatility and availability on so many platforms means you only have to learn it once, and can apply it everywhere.
Here’s my top 5 reasons why you should learn PowerShell
- Automation – you’ll be faster
- Accuracy – reduce mistakes
- Versatility – learning once enhances you everywhere
- Community – PowerShell has one of the most connected and welcoming communities in tech. Plugging into it will only help you become a better admin/engineer
- Relevant – PowerShell continues to grow and be adopted. If you’re not learning it, you won’t remain competitive in the job market
Beginning your path to learn PowerShell
PowerShell is easy to learn, but will take practice to master. This post kicks off a series of blogs and videos to help you learn PowerShell in an operationally focused way. Subscribe to the blog in the link on the right, follow on Twitter, or subscribe to the YouTube channel for ongoing updates.
There’s never been a better time to learn PowerShell. From spinning up Virtual Machines in Azure, to uploading objects to AWS S3, or simply managing your Windows environment more efficiently, PowerShell is a powerful tool to have in your technology toolbox.