Sunday, March 10, 2019

Powershell - Renaming multiple files/folders at once

Get-ChildItem -Path C:\projects *document-manager-* -Directory | ForEach-Object -Process {Rename-item -Path $_.Name -NewName ($_.name -replace "document-manager-","") -whatif}


Get-ChildItem -Path C:\projects *document-manager-* -Directory | ForEach-Object -Process {Rename-item -Path $_.Name -NewName ($_.name -replace "document-manager-","") -Verbose}

1 comment:

Jaspreet Singh said...

it is not working.. send some example.