Mittwoch, 30. November 2011

Rename files with Power Shell

Remove extension:
gci *.deploy |%{rename-item $_.fullname -newname $_.basename}


Rename replace with expression:
gci *.jpg | rename-item -newname {$_.name -replace '^','ico_'}


Check results with whatif:
gci *.deploy |%{rename-item $_.fullname -newname $_.basename -whatif}
gci *.jpg | rename-item -newname {$_.name -replace '^','ico_'} -whatif

Source

Keine Kommentare:

Kommentar posten