Hello everyone and welcome back to the Cognixia podcast. Every week, we get together to talk about the latest happenings, bust some myths, discuss new concepts, and a lot more from the world of digital emerging technologies. From cloud computing to DevOps, containers to ChatGPT, and Project management to IT service management, we cover a little bit of everything week after week, to inspire our listeners to learn something new, sharpen their skills, and move ahead in their careers.
In today’s episode, we talk about Microsoft PowerShell. We will talk about what Microsoft PowerShell is all about, what it is commonly used for, what the important features it offers, and how Microsoft Azure Administrators use Microsoft PowerShell to accomplish their tasks. So, let’s get started.
According to the official Microsoft documentation, PowerShell is a cross-platform task automation solution made up of a command-line shell, a scripting language, and a configuration management framework. PowerShell runs on Windows, Linux, and MacOS.
Microsoft PowerShell is an object-oriented automation engine and scripting language with an interactive command-line shell developed by Microsoft. It aims to help users configure systems and automate administrative tasks. It is quite a mature tool and has a proven as well as established record as an automation tool for users both within and outside the IT function. Originally, PowerShell was offered as a proprietary software however, now PowerShell is available on all Windows systems by default. In 2016, Microsoft open-sourced PowerShell and made it available both on MacOS as well as Linux systems.
So, what does PowerShell do?
PowerShell was designed to help users with automating their tasks. For instance, if you are looking to automate your batch processing, PowerShell is the tool to help you with this. If you want to create system management tools for your commonly implemented processes, then PowerShell is the tool for you.
Apart from this, PowerShell also serves as a replacement for Microsoft’s Command Prompt which goes back to the times of MS-DOS. PowerShell became the default command-line interface for Windows 10 with the build 14791, which is also how most of us today become acquainted with the PowerShell technology. With that, we can say that PowerShell is a modern command shell that includes the best features of many popular shells, however, unlike a lot of other shells which would only accept and return texts, PowerShell will accept and return .Net objects, making it so much more powerful and versatile compared to other shells.
If you would ask what would be the top features offered by PowerShell, we would say:
One, the robust command-line history it offers
Two, it’s completion and command prediction ability
Three, its excellent support for command and parameter aliases
Four, the pipeline it offers for chaining commands
And five, the in-console help system it offers which is very similar to the Unix man pages
Apart from serving as an excellent shell, PowerShell is also a very popular scripting language. A scripting language is not a programming language, though sometimes, the same language can be used as a programming language as well as a scripting language. Which language you choose to use – programming or scripting would depend entirely on the requirements and resources at hand. If you want to automate tasks within an existing environment or you want to prototype something quickly, it might be a good idea to use a scripting language. However, if you are building a whole new application from scratch, then the power, flexibility, and scalability you need would very likely come from using a programming language.
With that distinction clear, PowerShell is commonly used as a scripting language for automating system management. Users also use it in CI/CD environments to build, test, and deploy solutions. The important thing to remember here is that PowerShell is built on the .Net Common Language Runtime or the .Net CLR and all the input and output to and from PowerShell is in the form of .Net objects. Because of this, when using PowerShell, you wouldn’t need to parse text output to extract the information from the output. As a scripting language, PowerShell offers some cutting-edge features, such as:
One, it is extensible through functions, classes, scripts, and modules
Two, it has an extensible formatting system for easy outputs
Three, it offers an extensible type system for creating dynamic types
And four, it offers built-in support for common data formats like CSV, JSON, and XML
What do we mean when by extensible or the extensible nature of PowerShell? By extensible, we mean the ability to be modified and expanded. So, with PowerShell, you can create your own cmdlets (pronounced as command-lets). What are cmdlets? The commands for PowerShell are known as cmdlets. Though you can run any command available on your system in PowerShell, cmdlets are the native PowerShell commands, but they are not standalone executables. They are collected into PowerShell modules that can be loaded on demand. These cmdlets can be written in any compiled .Net language or in the PowerShell scripting language itself. These cmdlets follow a very typical nomenclature. The cmdlets are named in a special verb-noun pairing format. In the name of a cmdlet, the verb would identify the action that the cmdlet performs while the noun identifies the resource on which the cmdlet would be acting. For example, a cmdlet could be called “Get-Command”, meaning this cmdlet would get all the cmdlets that would be registered in the command shell.
Now, this brings us to the next question – who uses Microsoft PowerShell? We have established that PowerShell is a very useful tool that can help users accomplish a wide variety of tasks. Traditionally, PowerShell is used by people in the role of system administrators. But now, people working across various spaces, such as DevOps, Cloud Ops, and even developers are also using PowerShell. The versatility and importance of this tool are also why familiarity with PowerShell is usually essential to meet the eligibility for the Microsoft Certified Azure Administrator or when taking the AZ-104 Microsoft Azure Administrator certification examination.
So, why should one use PowerShell?
The foremost reason why one should use PowerShell or any command-line interface for that matter is that it will provide you with precise and repeatable control over a desired action or task flow that is difficult, maybe even impossible to replicate with a traditional GUI. Now, ideally, GUIs were designed to make things easier for us, but the fact is, they can be time-consuming, cumbersome, and error-prone, more so when the task is repeated several times over and over again. Compared to the traditional way, PowerShell gives users a CLI with a mature and detailed scripting language which even users with very, very basic programming skills can use to accomplish the tasks at hand. It can even handle highly complex and detailed tasks. Moreover, it offers users two very important things – automation and scalability. It lets the system do as much work as the environment demands, giving you the edge over traditional GUIs by offering a high level of automation and accuracy that the GUIs simply can’t match up to.
As we have mentioned before, familiarity and some experience working with Microsoft PowerShell are a prerequisite for the Certification exam AZ-104: Microsoft Azure Administrator. Cognixia’s AZ-104 training and certification program is 100% live online and instructor-led, enabling you to prepare for the exam from anywhere in the world. So, if you are looking to be a Microsoft Certified Cloud Administrator, then we highly recommend enrolling for our Microsoft Azure online training to help dot your Is & cross your Ts and put your best foot forward when appearing for the AZ-104 certification exam.
We hope that through this episode we have helped you understand a little bit about Microsoft PowerShell, why it is important, who uses it, why one should use it, and why it is essential to know about this tool when preparing for the AZ-104 Microsoft Azure Administrator certification exam. We also hope we inspired you to get certified and validate your skills and knowledge in the field, because trust us when we say this, it is immensely helpful when looking to advance your career in the field.
And with that, we come to the end of this week’s episode of the Cognixia podcast. We will be back again next week with a fresh new episode and some more interesting and insightful content for all your tech enthusiasts out there. Until then, happy learning!