Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save wilwang/a8b7f9a4021f295dafd5f835af5a9c2c to your computer and use it in GitHub Desktop.
Save wilwang/a8b7f9a4021f295dafd5f835af5a9c2c to your computer and use it in GitHub Desktop.
$targDir = "C:\dev\LMS-client-ADA";
Get-ChildItem $targDir -Filter *.pdf |
Foreach-Object {
$oldname = $_.FullName;
$newname = $_.FullName.Replace(" ", "_");
$newname = $newname -replace "[0-9]+\-[0-9]+\-[0-9]+_", "";
Rename-Item $oldname $newname;
$oldname;
$newname;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment