PowerShell Start-Process [With Real-World Examples]

PowerShell Start-Process

When working with PowerShell, I often need to launch external applications or processes. For these kinds of requirements, you can use the Start-Process cmdlet. In this tutorial, I will explain everything you need to know about the PowerShell Start-Process cmdlet, including various parameters, practical examples, and common troubleshooting tips. What is Start-Process in PowerShell? The … Read more

PowerShell For Loop With Index and Range Examples

powershell for loop with index and range example

In the previous tutorial, we discussed the PowerShell for loop. Now, I will show you some more advanced examples, known as PowerShell for loop with index and range examples. In this tutorial, I will show you some practical examples of using for loops with indexes and ranges in PowerShell, along with various techniques I’ve learned … Read more

PowerShell Throw Exception with Message

PowerShell Throw Exception with Message

Proper error handling is absolutely critical when developing PowerShell scripts, especially for production environments. One of the most powerful error handling techniques in PowerShell is throwing exceptions with custom messages. Over my years working with PowerShell, I’ve found that a PowerShell script should show proper exception messages, which can save hours of troubleshooting time. In … Read more

PowerShell ForEach [Looping Through Collections]

PowerShell ForEach

PowerShell’s foreach is a looping structure that helps automate repetitive tasks when working with collections of data. It comes in two forms: the foreach statement (a language construct) and ForEach-Object (a cmdlet often aliased as %). Both allow you to iterate through items in a collection and perform operations on each element, but they work … Read more

How to Delete User Profiles Using PowerShell in Windows 11?

One of my clients recently wanted us to delete old and unused user profiles from Windows 11 as they took up valuable disk space. You can manage user profiles using PowerShell. In this tutorial, I will explain how to delete user profiles using PowerShell in Windows 11. Note: Ensure you have administrative access to the … Read more

How to Generate SSH Keys with PowerShell

Generate SSH Keys with PowerShell

Recently, I was working on a project where I needed to set up secure connections between multiple servers. The issue is that most SSH key generation tutorials focus on using OpenSSH in Linux or Git Bash on Windows. However, PowerShell provides ways for SSH key management natively in Windows. In this article, I explain simple … Read more

How to Open PowerShell in a Folder?

Are you tired of navigating through multiple folders in the command prompt just to reach your desired directory? Do you wish there were a faster and more efficient way to open PowerShell in a specific folder? I’ll walk you through several methods to quickly open PowerShell in any folder on your Windows machine. Method 1: … Read more

How to List Directories and Files in PowerShell

Filter Files Recursively in PowerShell

As a PowerShell user since its early days, I have been using the Get-ChildItem cmdlet to list files and directories. In this tutorial, I will explain different methods to list directories and files in PowerShell, from basic commands to advanced filtering techniques that I’ve used. Get-ChildItem Cmdlet The Get-ChildItem cmdlet (which has aliases like dir … Read more

100 PowerShell cmdlets download free

100 POWERSHELL CMDLETS E-BOOK

FREE Download an eBook that contains 100 PowerShell cmdlets with complete script and examples.