PowerShell Copy-Item [With Examples]

PowerShell copy-item

If you work in the IT sector in the USA, then you will mostly use PowerShell to automate various administrative tasks. In today’s tutorial, I will explain various useful cmdlets, such as PowerShell Copy-Item. You will understand how to use the Copy-Item PowerShell cmdlet with various examples. To copy files in PowerShell, you can use … Read more

Get-ChildItem in PowerShell

powershell get-childitem

As a PowerShell developer, you might use Get-ChildItem cmdlet in your daily life. In this tutorial, I will explain how to work with Get-ChildItem cmdlet in PowerShell. To filter files larger than 1MB using PowerShell’s Get-ChildItem, you can combine it with Where-Object. For example, the command Get-ChildItem -Path “C:\Users\JohnDoe\Documents” -File | Where-Object { $_.Length -gt … Read more

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

100 PowerShell cmdlets download free

100 POWERSHELL CMDLETS E-BOOK

FREE Download an eBook that contains 100 PowerShell cmdlets with complete script and examples.