Rename a bunch of files/Directories
This has been quite useful to me as well Files:get-childitem “*.xml” | foreach { rename-item $_ $_.name.Replace(“NES-“, “NES-X”) }Replace Directories:Get-ChildItem -path PROD -Directory | ForEach-Object -Process {Rename-item -path $_.Name -NewName ($_.name.substring(4,8)) -Verbose }Another example:Get-ChildItem ‘C:\Temp\crs\documents’ | rename-item -newname { $_.name.substring(0,45) + ‘_Client_Report.pdf’} Here a viante to add a string to an existing file nameget-childitem “*.pdf”…

