Powershell - Rename Folder


Rename-Item cmdlet is used to rename a folder by passing the path of the folder to be renamed and target name.

Example 1

In this example, we'll rename a folder D:\Temp\Test to D:\Temp\Test1

Type the following command in PowerShell ISE Console

Rename-Item "D:\temp\Test Test1"

You can see the Test directory as Test1 directory now. There should not be another folder with same name already in the temp directory otherwise PowerShell command will fail.