Created
January 5, 2018 00:33
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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