Powershell - Rename Folder


Advertisements

Cmdlet

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 D:\temp\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.

powershell_files_folders.htm

Useful Video Courses


Video

Powershell for beginners

15 Lectures 3.5 hours

Fabrice Chrzanowski

Video

Learning Task Automation using Windows PowerShell

35 Lectures 2.5 hours

Vijay Saini

Video

The Complete PowerShell 7 course: Beginner To Advanced

145 Lectures 12.5 hours

Fettah Ben

Advertisements