Skip to content

Instantly share code, notes, and snippets.

@Sean12mps
Created February 3, 2022 17:54
Show Gist options
  • Select an option

  • Save Sean12mps/b04ec3091c4665746519366bdb383c8c to your computer and use it in GitHub Desktop.

Select an option

Save Sean12mps/b04ec3091c4665746519366bdb383c8c to your computer and use it in GitHub Desktop.
#Rename multiple files
---------------------
$i = 1;
$name = 'foobar';
$ext = 'jpg';
foreach ( $file in gci ) {
Rename-Item $file ( "$name-$i.$ext" );
$i++;
}
@Sean12mps
Copy link
Copy Markdown
Author

Rename multiple files in Windows using PowerShell.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment