A PowerShell User's Guide to Privilege Elevation: gsudo vs. Task Scheduler

For years, Linux and macOS users have enjoyed the convenience of the sudo command to run commands with administrative privileges. Now, the sudo experience has finally come to Windows in two popular forms: Microsoft’s official sudo, built into Windows 11, and the feature-rich, open-source gsudo. But which one do I use? This guide puts them in a head-to-head showdown, comparing their features, security, and best use cases to help me choose the right tool for my workflow. ...

December 14, 2025 · The PwshTips Team

Getting Started: A Complete Guide to Installing PowerShell on Windows and Linux

If you are still launching the blue icon named “Windows PowerShell”, you are using technology from 2016. pwsh (PowerShell 7+) is the modern, open-source, and cross-platform evolution of PowerShell. It runs on Windows, Linux, and macOS, and it’s the future of PowerShell. This guide explains why you should be using modern PowerShell and provides a complete, step-by-step tutorial for installing it on both Windows and Linux. Why Switch to Modern PowerShell? Windows PowerShell (v5.1): Built on the legacy .NET Framework. It is included with Windows but is now in maintenance mode, receiving only security fixes. PowerShell (v7+): Built on modern .NET. It’s open source, receives active feature updates, and is optimized for cloud and cross-platform automation. PowerShell 7 runs side-by-side with the older Windows PowerShell, so you can safely install it without breaking legacy scripts. Key features include: ...

December 14, 2025 · The PwshTips Team

PowerShell Interoperability: A Guide to Working with Bash and CMD

In modern IT, we rarely work in a pure environment. While PowerShell is the superior tool for structured automation, we often need to interact with other shells: Bash on Linux and CMD on Windows. Instead of choosing between them, a true power user masters their interoperability. This guide covers the essential “bridging” techniques to make these shells work together, built on one central concept. Part 1: The Core Concept - Objects vs. Text Understanding interoperability is simple if you remember one rule: PowerShell works with Objects; Bash and CMD work with Text. ...

December 14, 2025 · The PwshTips Team

PowerShell Remoting: The Ultimate Guide to WinRM and SSH

PowerShell Remoting is a cornerstone of Windows administration and automation. For years, it was synonymous with one protocol: WinRM. But with modern PowerShell and the ubiquity of SSH, we now have a powerful, cross-platform alternative. So, which protocol should you use? WinRM or SSH? This guide provides the definitive answer. We’ll explore the fundamental differences between the protocols, provide practical, step-by-step instructions for using both, and give clear recommendations for when to choose each one. ...

December 14, 2025 · The PwshTips Team

pwsh Start-Job and Wait-Job

PowerShell’s Start-Job is a powerful tool for running commands and scripts asynchronously as background processes. However, its behavior, especially when combined with Wait-Job and -Credential, often leads to confusion. This post demystifies how Start-Job works, why some installers fail silently inside jobs, and how to properly manage background tasks in PowerShell. Assigning Start-Job to a Variable: Why It Matters Consider these two commands. They both launch a background job to run a command prompt instruction. ...

November 26, 2025 · The PwshTips Team

$PSScriptRoot & %~dp0: Script's Home

When writing portable scripts, one of the first challenges is locating files relative to the script itself. Whether in PowerShell or a classic Batch file, I need a reliable way to find my script’s “home” directory. This guide breaks down the two most important tools I use for this job: $PSScriptRoot for PowerShell and %~dp0 for Batch. 1. The Batch Method cd /d %~dp0 In Windows Batch scripting (.bat, .cmd), the magic variable %~dp0 is the standard for getting the script’s directory. I often use it with cd to change the working directory. ...

November 12, 2025 · The PwshTips Team

File Transfer Speed: SCP vs. Robocopy vs. Copy-Item

When it comes to transferring large files (10–100 GB) between Windows systems, the tool I choose can have a massive impact on speed, reliability, and security. In this ultimate showdown, I compare three titans of file transfer: the secure and universal SCP (OpenSSH), the multi-threaded powerhouse Robocopy (SMB), and the PowerShell-native Copy-Item (WinRM). I tested them across different network conditions, from a high-speed 10 GbE LAN to a real-world 5G wireless connection, to help me decide which tool reigns supreme for my specific needs. ...

November 7, 2025 · The PwshTips Team

Automate Office 2021 Install & Remove Old Versions

When deploying Microsoft Office 2021, one of the key considerations is how to handle older, existing versions like Office 2010. By default, the modern Office installer will automatically remove these older versions, but for automated or customized deployments, you need more control. This guide will walk you through how I used the Office Deployment Tool (ODT) to create a silent, automated installation of Office 2021 that also cleanly removed any older Office versions. ...

November 4, 2025 · The PwshTips Team

Fixing Office Activation Firewall Issues

When I tried to activate Microsoft Office in a corporate or restricted network environment, I encountered frustrating activation failures. Even with a valid license, Office activation can fail if it cannot communicate with Microsoft’s activation servers. This is almost always due to a firewall blocking the necessary outbound traffic. Note: This guide assumes you have already installed Microsoft Office. If you need a guide on how to automate the installation of Office 2021, see our companion article: Automate Office 2021 Install & Remove Old Versions ...

November 4, 2025 · The PwshTips Team

Unblock-File Cmdlet in PowerShell

If I’ve ever downloaded a script, installer, or even a help file from the internet, I’ve likely encountered a frustrating Windows security feature: the file is “blocked,” preventing it from running or displaying correctly. This is due to the “Mark of the Web,” a security mechanism designed to protect me from potentially malicious content. PowerShell provides a simple and elegant solution to this problem: the Unblock-File cmdlet. This guide will explain what the Mark of the Web is, how to identify blocked files, and how to use Unblock-File to safely manage them. ...

October 29, 2025 · The PwshTips Team