Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save kevinblumenfeld/bdd76d76c7c900f26edc15dc71f02374 to your computer and use it in GitHub Desktop.
Save kevinblumenfeld/bdd76d76c7c900f26edc15dc71f02374 to your computer and use it in GitHub Desktop.
$badname = gc "C:\scripts\test\files.csv"
$oldname = gc "C:\scripts\test\filesNEW.csv"
$oldname.Length
$badname.Length
for ($i = 0; $i -lt $badname.Length; $i++) {
$bad = $badname[$i]
$old = $oldname[$i]
Rename-Item "c:\scripts\test\$bad" "c:\scripts\test\$old"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment