PowerShell Do-Until Loop Examples

powershell do until

PowerShell’s Do-Until loop allows actions to be repeated until a specified condition is met. In a Do-Until loop, the statements within the block are executed at least once before the condition is checked. This makes it different from other loops, where the condition is evaluated before any statements are executed. In this PowerShell tutorial, I … Read more

How to Append Text to a File in PowerShell?

Append Text to a File in PowerShell

Recently, I was working with a logging application. There, I got a requirement to append text to a file in PowerShell. In this PowerShell tutorial, I will show different methods to append data to a text file using PowerShell and how to append text to a new line in a text file using PowerShell. To … Read more

PowerShell Find and Replace in File

PowerShell Find and Replace in File

Finding and replacing a file is a very common requirement in automation. In this PowerShell tutorial, I will explain in detail how to find and replace in a file using PowerShell and also I will show how to replace a line in a file using PowerShell. To find and replace text in a file using … Read more

How to Convert an Array to a String in PowerShell?

Convert an Array to a String in PowerShell

Do you need to convert an array of elements into a single string in PowerShell? In this PowerShell tutorial, I will explain how to convert an array to a string in PowerShell. We’ll explore several methods to convert an array to a string in PowerShell, with complete examples. To convert an array to a string … Read more

How to Import CSV to Array in PowerShell?

powershell import csv into array

Recently, I got a requirement to import data from a CSV (Comma Separated Values) file into an array in PowerShell for further processing. In this tutorial, I will show you how to import CSV data into an array in PowerShell using different methods with examples. To import CSV data into an array in PowerShell, use … Read more

How to search for files recursively in PowerShell?

Search for files recursively in PowerShell

Are you trying to search files inside a directory and sub-directories? PowerShell made it easy. In this tutorial, I will explain to you how to search for files recursively in PowerShell. To search for files recursively in PowerShell, use the Get-ChildItem cmdlet with the -Recurse parameter. For example, to find all .txt files in a … Read more

How to Unblock Files Recursively using unblock-file in PowerShell?

When you download files from the internet, Windows may block these files to prevent potentially harmful scripts from running on your system. This can lead to a situation where you need to unblock numerous files, which can be quite difficult if done manually. Fortunately, PowerShell offers a powerful and efficient way to unblock files in … Read more

How to Get MD5 Hash of a File in PowerShell?

Get MD5 Hash of a File in PowerShell

MD5, which stands for Message Digest Algorithm 5, produces a unique 128-bit hash value for a given data set. While MD5 is no longer recommended for cryptographic purposes due to vulnerabilities, it’s still widely used for file integrity checks. PowerShell makes it easy to compute the MD5 hash of files. In this PowerShell post, I … Read more

How to Convert Files to Base64 in PowerShell?

Convert Files to Base64 in PowerShell

Recently, while working on an automation project, I got a requirement to encode files to Base64, a process that converts binary data into ASCII string format. I will show you here different methods to convert files to Base64 using PowerShell with examples and complete scripts. To convert a file to Base64 in PowerShell, you can … Read more

How to Check If a Folder Exists in PowerShell?

Check If a Folder Exists in PowerShell

Recently, I was working with some files and folder operations using PowerShell. I was trying to check if a folder exists in PowerShell. There are different methods to achieve it. To check if a folder exists in PowerShell, you can use the Test-Path cmdlet, which returns a Boolean value indicating the presence of the directory. … 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.