Skip to content

Instantly share code, notes, and snippets.

@Al-un
Created November 18, 2018 16:47
Show Gist options
  • Save Al-un/33d59b541e1822c84647ad53b9bc18be to your computer and use it in GitHub Desktop.
Save Al-un/33d59b541e1822c84647ad53b9bc18be to your computer and use it in GitHub Desktop.
Renaming files based on Regex matched groups
Get-ChildItem | Rename-Item -WhatIf -NewName {$_.Name -replace '(\d{2})-(\d{2})-(\d{4})', '$3-$2-$1' }
@Al-un
Copy link
Author

Al-un commented Nov 18, 2018

WhatIf to see the output without running the command

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