How to Check if a String Starts with a Number in PowerShell?

powershell check if string starts with number

While working with string manipulations in PowerShell, I got a requirement to determine if a string starts with a number. In this tutorial, we will explore different methods to check if a string starts with a number in PowerShell with examples. To check if a string starts with a number in PowerShell, you can use … Read more

How to Check if a String Contains Only Numbers in PowerShell?

powershell check if string contains only numbers

One of my team members was searching for a PowerShell script to check if a string contained only numeric characters. I suggested a few methods. In this tutorial, I will explain how to check if a string contains only numbers in PowerShell using various methods. To check if a string contains only numbers in PowerShell, … Read more

How to Convert String to JSON in PowerShell?

Convert String to JSON in PowerShell

Recently, one of my clients asked me to convert a string to JSON for an automation script. I tried various methods in PowerShell. In this PowerShell tutorial, I will show you how to convert string to JSON in PowerShell using different methods. To convert a string to JSON in PowerShell, the most common and straightforward … Read more

How to Convert String to Int in PowerShell?

Convert String to Int in PowerShell

Recently, one of my team members struggled to figure out how to convert a string to an int in a PowerShell automation script. I suggested a few methods. In this tutorial, I will show you how to convert string to int in PowerShell using six methods with examples. To convert a string to an integer … Read more

How to Convert String to Boolean in PowerShell?

PowerShell convert string to Boolean

While working on a PowerShell script, I got a requirement to convert a string to a boolean. There are different methods for this. In this tutorial, I will explain how to convert string to boolean in PowerShell using various methods with examples. To convert a string to a Boolean in PowerShell, you can use several … Read more

PowerShell IsNullOrEmpty() Example

PowerShell isnullorempty

Recently, I got a requirement to check whether a variable or string is null or empty. I tried this using the IsNullOrEmpty() method in PowerShell. In this tutorial, I will show you examples related to the PowerShell IsNullOrEmpty() method. What Are Null and Empty in PowerShell? Before checking a few examples of IsNullOrEmpty method, let’s understand what … Read more

How to Concatenate String and Variable in PowerShell?

Concatenate String and Variable in PowerShell

Recently, I was required to concatenate strings with variables in PowerShell. I tried different methods. In this tutorial, I will explain how to concatenate strings and variables in PowerShell with examples. To concatenate strings with variables in PowerShell, you can use the + operator, which directly combines strings and variables. For example, $city = “New … Read more

Concatenate String with NewLine in PowerShell

powershell concatenate string with new line

Recently I got one requirement from one of my clients to concatenate a string with new line. I tried it using different methods using PowerShell. In this tutorial, I will show you how to concatenate strings with new line in PowerShell using various methods. To concatenate strings with a new line in PowerShell, you can … Read more

How to Concatenate Strings Inside Loops in PowerShell?

PowerShell Concatenate Strings Inside Loops

In one of the tutorials, I explained how to concatenate strings in PowerShell. Here, I will show you an advanced concept. I will explain how to concatenate strings inside loops in PowerShell using various methods. I will show how to do this in for loop, foreach loop, etc. String concatenation is the process of joining … Read more

How to Substring in PowerShell?

substring in PowerShell

Working with Substrings in PowerShell is a very common requirement when manipulating strings. Most of the time, I am required to get a substring of a string. In this PowerShell tutorial, I will explain how to substring in PowerShell and how to use the substring() method in PowerShell with various examples. To substring in PowerShell using the … 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.