How to Convert Number to String in PowerShell?

Convert Number to String in PowerShell

In this tutorial, I will explain how to convert a number to a string in PowerShell using various methods with examples. PowerShell is built on the .NET framework, which means every piece of data has a specific type (e.g., Int32, Double, String). When you perform a conversion, you aren’t just changing the “look” of the … Read more

PowerShell Find File by Name Wildcard Examples

PowerShell Find File by Name Wildcard

PowerShell provides powerful file search capabilities using wildcard patterns and cmdlets. In this tutorial, I will explain how to find files by name wildcard in PowerShell with examples. You will learn multiple methods to locate files using pattern matching in PowerShell. What Are Wildcards? Before we dive in, let’s understand wildcards: Examples: Method 1: Using … Read more

How to Find the Most Recent File in a Directory with PowerShell?

Find the Most Recent File in a Directory with PowerShell

One of my clients recently asked for a PowerShell script to find the most recent file in a directory. This might be something like grabbing the latest log file for troubleshooting, finding the most recent backup before running a script, or locating today’s report. In this tutorial, I’ll walk you through three different methods for … Read more

How to Find Dates in Strings with PowerShell?

powershell find date in string

Have you ever needed to pull dates out of log files, email subjects, filenames, or messy text data? Maybe you’re parsing server logs to find when errors occurred, or you need to extract invoice dates from a pile of documents. Finding and extracting dates from strings is one of those tasks that seems simple until … Read more

How to Find and Remove Stale Computer Objects in Active Directory with PowerShell?

If you manage Active Directory, you’ve probably noticed that computer accounts tend to pile up over time. Machines get replaced, users switch laptops, or systems are decommissioned — but those old computer objects? They often stick around in AD. These stale computer accounts aren’t just clutter. They can create security vulnerabilities (imagine an attacker reactivating … Read more

How to Find Public Folder Paths in PowerShell?

While working with Exchange public folders, I was required to find public folder paths. Most Exchange PowerShell cmdlets require the complete folder path in the -Identity parameter. In this tutorial, I will show several efficient ways to find public folder paths quickly using PowerShell. I will also explain how to search for folders by name … Read more

PowerShell For Loop 1 to 10 [With Examples]

PowerShell For Loop 1 to 10

I will explain a fundamental topic today, PowerShell for loop 1 to 10. The simple “loop from 1 to 10” is the perfect starting point because it teaches you the fundamental pattern you’ll use to automate countless repetitive tasks. Once you understand this basic structure, you’ll be able to adapt it to loop through anything: … Read more

How to Break Out of ForEach Loops in PowerShell?

Break Out of ForEach Loops in PowerShell

Suppose, you’re looping through thousands of files, user accounts, or log entries, searching for one specific item. Once you find it, why keep looping through the rest? That’s where breaking out of a foreach loop becomes very useful. It saves processing time, makes your scripts more efficient, and prevents unnecessary work. In this tutorial, I … Read more

How to Find Strings in PowerShell Hash Tables?

Find Strings in PowerShell Hash Tables

If you’ve ever built a PowerShell hash table to store configuration data, user information, or server details, you’ve probably run into this scenario: you need to find something, but you’re not sure which key it’s under—or maybe you need to search through all the values to see what matches. Hash tables are fantastic for quick … Read more

How to Find Passwords in Files with PowerShell?

Let’s be honest: people still store passwords in plain text files. I’ve seen it countless times — a “passwords.txt” sitting on someone’s desktop, a Word doc named “Important Logins.docx,” or configuration files with hardcoded credentials. It’s a security nightmare waiting to happen. But you can use PowerShell to scan directories quickly and identify potential security … 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.