DevOps
PowerShell
Introduction

Introduction to PowerShell

PowerShell is a cross-platform task automation solution made up of a command-line shell, a scripting language, and a configuration management framework.

What is PowerShell?

While traditional shells like Bash are text-based (passing strings between commands), PowerShell is object-oriented. It is built on the .NET framework, meaning it passes structured objects instead of raw text.


🚀 Key Philosophy: Everything is an Object

In Bash, ls returns a string. To get a file size, you must use awk or cut to parse that string. In PowerShell, Get-ChildItem (the equivalent of ls) returns a FileInfo Object.

# In PowerShell, you just access the property directly
(Get-ChildItem "report.txt").Length

Core Features

  • Cmdlets: Built-in commands that follow a Verb-Noun pattern.
  • Alias Support: Provides familiar aliases like ls, cd, and curl for Bash/CMD users.
  • Cross-Platform: PowerShell Core runs on Windows, Linux, and macOS.

PowerShell Versions

VersionFoundationPlatformStatus
Windows PowerShell (5.1).NET FrameworkWindows OnlyLegacy / Pre-installed
PowerShell Core (7.x).NET CoreCross-PlatformRecommended for DevOps

[!TIP] Check your version Run $PSVersionTable in your terminal to see which version of PowerShell you are currently using.