PowerShell ForEach Loop [With Examples]

PowerShell foreach loop

To become an expert in PowerShell, you should know how to work with the foreach loop. I will explain the nested foreach loop and error handling in a PowerShell foreach loop in detail. The PowerShell Foreach loop iterates through arrays, cmdlets, or script files. It simplifies repetitive tasks by processing each item in a collection. … Read more

While Loop in PowerShell [With Examples]

PowerShell While Loop Examples

You should know about looping if you want to iterate through items until a condition is met in PowerShell. I will show you how to use the while loop in PowerShell in this tutorial with a few examples. What is a While Loop in PowerShell? A while loop is a control flow statement that enables you to … Read more

PowerShell For Loop [With Examples]

PowerShell for loop try catch

Recently, while working on a PowerShell script, I was required to iterate over a block of code multiple times. For this, I used the for loop in PowerShell. In this tutorial, I will show you how to work with the PowerShell for loop with various examples. What is a for loop in PowerShell? A For loop in … Read more

How to Trim Strings in PowerShell?

Trim Strings in PowerShell

If you are working with strings, you will have a very common requirement of trimming a string in PowerShell. There are various methods to do this. In this tutorial, I will show you how to trim strings in PowerShell using various methods. To trim strings in PowerShell, you can use methods like Trim(), TrimStart(), and TrimEnd(). These methods … Read more

How to Use Exclamation Mark in PowerShell If Statements?

Exclamation Mark in PowerShell If Statements

In one of the previous tutorials, I explained how to use the if-else statement in PowerShell. Now, I will show you how to use exclamation mark in PowerShell If Statements. An exclamation mark (!) serve as a logical negation operator; we can use it in PowerShell if statements. Exclamation Mark in PowerShell If Statements If … Read more

How to Convert Strings to Lowercase or Uppercase in PowerShell?

Convert Strings to Lowercase in PowerShell

Almost all the PowerShell scripts I have worked on, especially those related to strings, always require converting strings to lowercase or uppercase. So, I thought of writing a complete tutorial on this. In this tutorial, I will show you how to convert strings to lowercase or uppercase in PowerShell using various methods. To convert strings … Read more

PowerShell Function Examples with Parameters

powershell function example multiple parameters

As a PowerShell developer, you should know how to use parameters in PowerShell functions. In this tutorial, I will show you how to create PowerShell functions with parameters, including both single and multiple parameters. PowerShell function with Parameter Let’s start with a simple example of a PowerShell function that accepts a single parameter. This can … Read more

How to Check if a String Contains Multiple Values in PowerShell?

Check if a String Contains Multiple Values in PowerShell

While working on a PowerShell script, I was required to check if a string contains multiple values. I tried different methods, and in this tutorial, I will show you how to do so with complete scripts and examples. To check if a string contains multiple values in PowerShell, you can use the -match operator with … 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.