How to Convert CSV to HTML Table in PowerShell?

convert csv to html table in powershell

PowerShell provides an efficient way to convert CSV data into HTML tables if you’re working with data in CSV files and need to present it in an HTML format. In this tutorial, I will explain how to convert CSV to an HTML table in PowerShell using different methods with examples. To convert a CSV file … Read more

How to Add Date to Filename Using PowerShell?

Add Date to Filename Using PowerShell

One of my team members was working on some files in PowerShell, and they had to add the current date to the file name. I suggested a few methods. In this tutorial, I will explain how to add the date to a filename using PowerShell with examples. To add a date to a filename during … Read more

How to Sort Files by Date in PowerShell?

powershell sort files by date

Recently, someone asked me about sorting files by date in PowerShell. In this tutorial, I will show you how to sort files by date in PowerShell using different methods with examples. To sort files by date in PowerShell, you can use the Get-ChildItem cmdlet combined with Sort-Object. For example, to sort files in the C:\Logs … Read more

How to Convert JSON to CSV in PowerShell?

Convert JSON to CSV in PowerShell

Today, I have an important requirement regarding converting JSON to CSV in PowerShell. There are various methods to do this. In this tutorial, I will show you how to convert JSON to CSV in PowerShell using different methods with examples. To convert a JSON variable to CSV in PowerShell, first load the JSON data using … Read more

PowerShell: IsNullOrEmpty vs IsNullOrWhiteSpace

powershell isnullorempty vs isnullorwhitespace

When working with strings in PowerShell, checking whether a string is null, empty, or consists solely of whitespace characters is often necessary. PowerShell provides two methods to perform these checks: IsNullOrEmpty and IsNullOrWhiteSpace. In this PowerShell tutorial, I will show the differences between IsNullOrEmpty() and IsNullOrWhiteSpace() methods. The primary difference between PowerShell IsNullOrEmpty() and IsNullOrWhiteSpace() is that IsNullOrWhiteSpace considers strings that contain only whitespace … Read more

How to Get the First 10 Files in a Folder Using PowerShell?

Get the First 10 Files in a Folder Using PowerShell

It is easy to get files from a folder using PowerShell based on some conditions. In this PowerShell tutorial, I will show you multiple methods to get the first 10 files in a folder using PowerShell, ordered by their last modified date. Method 1: Using Get-ChildItem and Sort-Object To get the first 10 files in … Read more

How to Get Unique Values from CSV Using PowerShell?

Get Unique Values from CSV Using PowerShell

One of my clients was working on a CSV file, and they were required to find unique values from that CSV file. I suggested using PowerShell and told them a few methods. In this tutorial, I will explain to you four simple and useful methods to get unique values from CSV using PowerShell. Get Unique … Read more

How to Get Unique Lines from a File Using PowerShell?

Get Unique Lines from a File Using PowerShell

When working with text files in PowerShell, I got a requirement to extract unique lines from a file. I tried different methods and thought to share them with you. In this tutorial, we’ll check several methods to get unique lines from a file using PowerShell. Get Unique Lines from a File Using PowerShell PowerShell is … Read more

How to Count Duplicate Lines in a Text File Using PowerShell?

Count Duplicate Lines in a Text File Using PowerShell

Recently, I was working on some text files where I was required to count the number of duplicate lines using PowerShell. I have tried different methods to do this. In this tutorial, we’ll explore different ways to count duplicate lines in a text file using PowerShell. Method 1: Using Group-Object PowerShell provides the Group-Object cmdlet … Read more

How To Create File If Not Exists In PowerShell? [4 Methods]

Create File If Not Exists In PowerShell

One of my clients recently required me to create a file if it doesn’t exist. PowerShell is the best option for this kind of requirement. In this tutorial, I will show you different methods to check for the existence of a file and create it if it doesn’t exist using PowerShell. To create a file … 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.