Posted By

evito on 11/01/16


regex rename PowerShell

Versions (?)

Who likes this?

1 person have marked this snippet as a favorite


PowerShell: Rename directory items by regex

 / Published in: Windows PowerShell

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.

  1. Get-ChildItem ./ | Rename-Item -NewName {$_\3.Name -replace '^(_\d+_)',''}

Report this snippet  

You need to login to post a comment.