Skip to content

Instantly share code, notes, and snippets.

@ekovac
Created January 5, 2018 00:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ekovac/d749f5191f279ec9fd6b496cc984ba00 to your computer and use it in GitHub Desktop.
Save ekovac/d749f5191f279ec9fd6b496cc984ba00 to your computer and use it in GitHub Desktop.
Rename files in a backup generated by the Windows 10 backup utility to their original name.
Foreach ($item in Get-ChildItem -File -Recurse)
{
$newName = $item.Name -replace '\(\d{4}_\d{2}_\d{2} \d{2}_\d{2}_\d{2} UTC\)',''
Rename-Item -Path $item.PSPath -NewName $newName
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment