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

How to Delete Files Older Than X Days in PowerShell?

Delete Files Older Than X Days in PowerShell

If you want to maintain and organize files, then it is good to regularly delete files that are no longer needed, specifically files that are older than a certain number of days. In this tutorial, I will show you how to delete files older than X days in PowerShell. To delete files older than a … Read more

How to Get File Name Without Extension in PowerShell?

Get File Name Without Extension in PowerShell

Recently, one of my clients asked me to write a PowerShell script to find file names without extensions in a folder. I tried different methods. In this PowerShell tutorial, I will explain how to get file name without extension in PowerShell using several methods. To get the filename without the extension in PowerShell, you can … Read more

How to Create an Empty File in PowerShell?

Create an Empty File in PowerShell

Do you need to create an empty file in PowerShell? This is a very common requirement for PowerShell administrators. In this tutorial, we’ll explore different methods to create an empty file using PowerShell. To create an empty file in PowerShell, you can use the New-Item cmdlet with the syntax New-Item -Path .\example.txt -ItemType File, which … Read more

How To Get Newest File In Directory In PowerShell?

Get Newest File In Directory In PowerShell

My client wanted to do some file operations on the newest file in a directory. So, I used various PowerShell methods to get the newest file in a directory in PowerShell. To get the newest file in a PowerShell directory, you can use the Get-ChildItem cmdlet combined with Sort-Object. For example: This command retrieves the files in the … Read more

How to Create a Password-Protected Zip File Using PowerShell?

Create a Password-Protected Zip File Using PowerShell

Recently, one of my clients asked me to create an encrypted zip file. I tried PowerShell. In this PowerShell tutorial, I will show you how to create a password-protected zip file using PowerShell. To create a password-protected zip file in PowerShell, you can use the Compress-Archive cmdlet combined with a third-party tool like 7-Zip. Here’s an example … 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.