How to Concatenate String and Integer in PowerShell?

powershell concatenate string and int using Join-String

Recently, I was working on a PowerShell task that required me to concatenate a string with an integer. I tried different methods. Let me show you how to concatenate strings and integers in PowerShell. To concatenate a string and an integer in PowerShell, you can use the + operator, which automatically converts the integer to a string: $result … 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 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

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

How to Check if a String Contains a Substring in PowerShell?

Check if a String Contains a Substring in PowerShell

Recently, I got a requirement from one of my clients to check if a string contains a substring. I tried various methods in PowerShell. In this tutorial, I will explain how to check if a string contains a substring in PowerShell using various methods with examples. To check if a string contains a substring in … Read more

How to Check if a String Contains Special Characters in PowerShell?

Check if a String Contains Special Characters in PowerShell

In PowerShell, you can use various methods like contains() methods to check if a string contains special characters in PowerShell. Let us check all the methods with examples. To check if a string contains special characters in PowerShell, you can use the -match operator with a regular expression pattern like [^a-zA-Z0-9], which matches any non-alphanumeric … Read more

PowerShell If-Else String Comparison [With Examples]

PowerShell if else string comparison

In this tutorial, I will explain how to work with string comparison in PowerShell if else. I hope you know how an if-else statement works in PowerShell. Here, we will see a few examples of PowerShell if-else string comparison. PowerShell If-Else String Comparison Before showing you the string comparisons, let me give you an overview … Read more

How to Convert Multiline String to Single Line in PowerShell?

Convert Multiline String to Single Line in PowerShell

Are you required to convert a multiline string to a single line in PowerShell? In this tutorial, I will show you how to convert multiline strings to single line in PowerShell using various methods. To convert a multiline string to a single line in PowerShell, you can use the -replace operator to replace newline characters … 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.