I’ve been having issues with a script i’m writing;
The script needs to be PowerShell V2 compatible as the system I’m running it on cannot be upgraded.
It loops through all files with in a folder and removes a specific portion of the name. I have about 116,000 files to loop through.
If it comes across a file that has the same name while renaming, it deletes it if it has the same length or it renames it appending the end of the file to indicate the amount of files with duplicate names but with different file sizes.
The script almost works perfectly, but some times when there are multiple items with the same name after renaming and they have different lengths it allows 2 files with the same length through the delete check process.
The script its quite messy as some of the files have multiple (.) Periods in them and I only want to work with the end of the file when removing the part of the file name specified in my regex pattern.
I’m sorry if this is confusing,
Let me know if there is anymore information I can provide.
Thank you for your time.