Powershell one-line script to remove the bracketed date from filenames

Get-ChildItem -Recurse | Where-Object { $_.Name -match " ?\(\d\d\d\d_\d\d_\d\d \d\d_\d\d_\d\d UTC\)" } | Rename-Item -NewName { $_.Name -replace " ?\(\d\d\d\d_\d\d_\d\d \d\d_\d\d_\d\d UTC\)", ""}
Removes the annoying filehistory filename default of adding a really long UTC time and date string to every single file. Non recursive so you will have to run this per directory.

0
2020-04-17 20:20:44

What Others Think

That worked very efficiently. Thanks much for the help. whatsapp sniffer
sniffer · 18 weeks and 5 days ago
the script article soo helpful in coding and have a visit with gbwhatsapp apk
monaa · 18 weeks and 3 days ago
There are many websites for you to find places you need to visit, but you should visit this site. I think you will not be disappointed. mapquest driving directions
pikachu88 · 14 weeks and 5 days ago
It was good information that I can get to know from here. It was very helpful to me. Hostsailor Thanks a lot for sharing this much information regarding this. I expect more such articles from you in the coming days.
zaiyamariya · 7 weeks and 5 days ago
Don’t know how to do academic assignments? Go to [url=https://qweetly.com] https://qweetly.com [/url] and have a look at samples of A-winning assignments. They are free.
GraceJordan · 6 weeks and 6 days ago
Hi, very interesting post. This is really great stuff. Thank you for sharing. GHD Sports for Android
GHDSPORTS · 5 weeks ago
Great article! word to pdf help me so much
emmajoe · 2 weeks and 4 days ago
rubbish removal UK
saeed20 · 2 weeks and 3 days ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: