Install PowerShell (pwsh) on Linux

PowerShell is no longer just for Windows. As a powerful, open-source scripting language and shell, PowerShell (pwsh) is now fully supported on Linux, allowing you to manage cross-platform environments, automate tasks, and use a consistent scripting language across your entire infrastructure. This guide provides step-by-step instructions for installing PowerShell on the most popular Linux distributions, including Ubuntu, Debian, Fedora, and Arch Linux. Why Install PowerShell on Linux? Cross-Platform Scripting: Write one script that can run on both Windows and Linux. Object-Oriented Shell: Unlike traditional text-based shells, PowerShell works with objects, making it easier to manipulate and manage data. Powerful Cmdlets: Leverage a rich ecosystem of cmdlets for managing systems, files, and services. Automation: Automate complex administrative tasks across a mixed-OS environment. Method 1: Installing on Debian and Ubuntu This is the most common method and is officially supported by Microsoft. We’ll use Ubuntu 22.04 as an example, but the steps are identical for recent versions of Debian and other Ubuntu derivatives. ...

October 24, 2025 · The PwshTips Team

PowerShell: New Operators (&&, ||, ??, ?:)

PowerShell has evolved significantly over the years, and with the release of PowerShell 7, it introduced several modern operators that make scripting more efficient, readable, and aligned with other popular programming languages like C# and JavaScript. This guide provides a deep dive into these new operators, showing you how they can simplify your code and make your scripts more robust. The key operators we’ll cover are: && and || — Pipeline chain operators ?? and ??= — Null-coalescing operators ?: — Ternary operator 1. Conditional Execution: The Pipeline Chain Operators (&& and ||) Introduced: PowerShell 7.0 ...

October 24, 2025 · The PwshTips Team

Get-ADUser: Querying Active Directory with PowerShell

Querying Active Directory (AD) is a fundamental task for any Windows administrator. Whether you need to generate a report, audit user accounts, or automate a task, PowerShell’s Get-ADUser cmdlet is the most powerful and flexible tool for the job. This guide will walk you through everything you need to know to get started with Get-ADUser, from basic queries to advanced filtering and exporting your results to a CSV file. Prerequisites Before you can use Get-ADUser, you need to have the Active Directory module for PowerShell installed. This is part of the Remote Server Administration Tools (RSAT). ...

October 20, 2025 · The PwshTips Team

Install winget on Windows

The Windows Package Manager, better known as winget, is a powerful command-line tool that dramatically simplifies the process of managing software on Windows. Instead of manually downloading installers from websites, you can use winget to find, install, upgrade, and uninstall applications directly from your terminal. This guide explains what winget is, how to check if you already have it, and how to install or update it. What is winget? winget is a free and open-source package manager developed by Microsoft. It brings the convenience of Linux package managers (like apt or yum) to the Windows ecosystem. With winget, you can automate the setup of a new machine or keep your existing software up-to-date with a single command. ...

October 20, 2025 · The PwshTips Team

What is pwsh? Modern PowerShell Explained

If you’ve worked with PowerShell, you’re likely familiar with powershell.exe. But in recent years, a new executable has emerged: pwsh.exe. So, what is pwsh, and how is it different? In short, pwsh is the executable for modern, open-source, and cross-platform PowerShell (version 6 and newer). It represents a fundamental evolution of PowerShell, transforming it from a Windows-only tool into a powerful automation language for any platform. This guide will explore the history of pwsh, its key features, and why you should be using it for all your new scripting and automation projects. ...

October 13, 2025 · The PwshTips Team