How to Find File by Name in PowerShell?

One of my team members got a requirement to find files by name using PowerShell while working on an automation project. In this tutorial, I will show you different methods to find files by name in PowerShell. To find a file by name using PowerShell, you can utilize the Get-ChildItem cmdlet combined with the -Name parameter for a basic … Read more

How to Delete Contents of Folder in PowerShell?

Delete Contents of Folder in PowerShell

It is easy to delete the contents of a folder using PowerShell. Do you have a similar requirement? In this blog post, we’ll explore different methods to delete the contents of a folder using PowerShell with complete scripts. To delete the contents of a folder in PowerShell, use the Remove-Item cmdlet with the path to … Read more

How to Count Files in a Folder Using PowerShell?

Count Files in a Folder Using PowerShell

You might encounter situations where you need to count the number of files present in a folder using PowerShell. In this tutorial, I will explain how to count files in a folder using PowerShell. To count files in a folder using PowerShell, you can use the Get-ChildItem cmdlet combined with the Measure-Object cmdlet. For example, … Read more

How to Rename Files with Date in PowerShell?

Rename Files with Date in PowerShell

Recently, I got a requirement to rename a file by appending the current date in PowerShell. I tried different methods, and in this PowerShell tutorial, I will explain to you how to rename files with date in PowerShell using various methods. To rename a file in PowerShell and append the current date, you can use … Read more

How to Encrypt a File with a Password in PowerShell?

Do you want to know how to encrypt a file in PowerShell using password? In this tutorial, we’ll explore different methods to encrypt a file with a password in PowerShell. This way, you can secure your files with password protection using PowerShell. To encrypt a file with a password in PowerShell, you can utilize the … Read more

How to Write Multiple Lines to a File in PowerShell?

Write Multiple Lines to a File in PowerShell

One common task that PowerShell administrators and developers often need to perform is writing multiple lines of text to a file. This can be for various purposes, such as logging, configuration, or documentation. In this article, we will explore different methods to write multiline strings to a file using PowerShell. To write multiple lines to … Read more

How to Read the First Line of a File in PowerShell?

Read the First Line of a File in PowerShell

A common task when working with text files in PowerShell is reading the first line of a file. PowerShell provides several ways to get the first line of a file, and in this blog post, we will explore different methods to read the first line of a file using PowerShell. To read the first line … Read more

How to Get File Modified Date in PowerShell?

Get File Modified Date in PowerShell

If you want to know how to get file modified date in PowerShell, check out this tutorial completely. In this blog post, we will explore various methods to retrieve file modification dates using PowerShell. To get the file modified date in PowerShell, you can use the Get-Item cmdlet followed by the LastWriteTime property. For example, … Read more

How to List File Names Only in PowerShell?

Get File Names Only Using Get-ChildItem Cmdlet

You can do crazy things in PowerShell, one of which is to get file names only. In this article, I will show you how to list file names only in PowerShell. To list file names only in PowerShell, you can use the Get-ChildItem cmdlet combined with the -Name parameter. For example, Get-ChildItem -Path “C:\Your\Directory” -Name … Read more

PowerShell Write-Host to File [With Examples]

PowerShell Write-Host to File

Recently, I was required to write the output of Write-Host to a file in PowerShell. I did extensive research to find different approaches and best practices. In this tutorial, we will discuss everything about PowerShell Write-Host to file with examples. To write the output of Write-Host to a file in PowerShell, you can use 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.