PowerShell: Rename directory items by regex

/ Published in: Windows PowerShell
Save to your folder(s)

Renames all the files in the working directory from given regex pattern, in this case removes a series of digits (e.g. \_0004\_) that Photoshop appends when exporting layers.

Copy this code and paste it in your HTML
  1. Get-ChildItem ./ | Rename-Item -NewName {$_.Name -replace '^(_\d+_)',''}

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.