randle Posted February 21, 2013 Posted February 21, 2013 Hi I'm wondering whether it's possible using PowerShell to rename a file based on it's extension and age!? To explain in a little more detail. I have a folder which contains a number of files called "Text.dll.Date.RandomNumbers.old" however, I only want to rename the latest version of these files. I'm sure there must be a way around it!? I'm thinking it starts with "get-childItem "\\FileLocation\*.old |........"?
randle Posted February 21, 2013 Author Posted February 21, 2013 Turns out you can do this by using the following code gci path | sort LastWriteTime | select -last 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now