Powershell Script to Remove Duplicate File/Folder Versions

Completed Posted 4 years ago Paid on delivery
Completed Paid on delivery

I have a folder with thousands of sub-folders and documents. I need a script (Powershell or Visual Basic - I prefer PS) that I can run that will traverse the files/folders and rename any duplicate named files and/or folders while not changing the file name for the latest version. If you are good at PowerShell, this should be a fairly simple project for you to complete quickly and to get a 5 star rating from me.

If there are duplicate file or directory names (they will always have the literal '_Version_' in their name. Any document or folder that does not have that literal should not be touched for any reason. There script will need to traverse through the entire directory tree (it can have many subfolders).

For instance, here is a sample directory with 6 files.

\Folder\subFolder\[login to view URL]

\Folder\subFolder\[login to view URL]

\Folder\subFolder\[login to view URL]

\Folder\subFolder\[login to view URL]

\Folder\subFolder\[login to view URL]

\Folder\subFolder\[login to view URL]

After the PS script is run, notice how the first 3 versions of the file have '_DELETEME' appended to their name while Version 4 (the latest version) file name did not change?

\Folder\subFolder\[login to view URL]

\Folder\subFolder\[login to view URL]

\Folder\subFolder\[login to view URL]

\Folder\subFolder\[login to view URL]

\Folder\subFolder\[login to view URL]

\Folder\subFolder\[login to view URL]

The above example shows a folder that has duplicate file names, but the same applies to folder names. (Yes, the file names have a .pdf in their names, that should not affect anything but I wanted to point that out.)

\Folder\subFolder\subFolder2\jdox_ax15326 XYZ [login to view URL]\

\Folder\subFolder\subFolder2\jdox_ax15326 XYZ [login to view URL]\

\Folder\subFolder\subFolder2\jdox_ax15326 XYZ [login to view URL]\

After the script is run, these directories would look like this:

\Folder\subFolder\subFolder2\jdox_ax15326 XYZ Memo_Version_1.pdf_DELETEME\

\Folder\subFolder\subFolder2\jdox_ax15326 XYZ Memo_Version_2.pdf_DELETEME\

\Folder\subFolder\subFolder2\jdox_ax15326 XYZ [login to view URL]\

Notice that '_DELETEME' was appended to the first 2 folder names and the the third (latest) folder name was untouched.

If you have the experience and can do this quickly, please respond. I will send the recipient a sample directory structure to validate that the script works as it should.

Powershell Visual Basic

Project ID: #24071955

About the project

13 proposals Remote project Active 4 years ago

Awarded to:

kostiapl

Hi. You described your task very cleverly, thanks. At first it seems that simple Get-ChildItem with -Recurse parameter is exactly what is needed but renaming directories adding a little nuance in my opinion (if we chan More

$50 USD in 7 days
(6 Reviews)
3.0

13 freelancers are bidding on average $48 for this job

schoudhary1553

Hello, I can help you with your project - Powershell Script to Remove Duplicate File/Folder Versions I have gone through your job posting and become very much interested to work with you. I am an expert in this fiel More

$120 USD in 3 days
(172 Reviews)
7.6
goodwork20k

I am good in powershell along with automation and development, please let me know if you are good to award this project to me

$50 USD in 3 days
(34 Reviews)
5.3
DebasisB

Hello there, I am interested in the project. I have expertise in powershell and I am sure I can deliver the script exactly as per your requirement. Thank You.

$50 USD in 1 day
(35 Reviews)
5.6
AdrianCJ

I can do it in PowerShell. I use it on a daily basis to manipulate files/registry/AD Users and this sounds like a pretty straightforward project. I will need a directory+file sample for testing purposes and let me know More

$40 USD in 2 days
(6 Reviews)
3.2
krishsathish02

Hi Client , I have experience on this with PowerShell, I can finish this. I’m a Senior Software Developer & Freelance Web & Automation developer with 5+ years of experiences with Master degree holder and expertise More

$14 USD in 1 day
(1 Review)
0.4
umarhussain15

Hi, I can write the required script for you with PowerShell to rename old versions of files and folders recursively. I have good experience with scripting in Linux and Windows to perform various tasks like file creatio More

$50 USD in 2 days
(0 Reviews)
0.0
chinna542

Hi, I use PowerShell scripts in my day to day full time job for documents batch processing. please send me the sample directory if you prefer me. Thanks Venkatesh

$50 USD in 2 days
(0 Reviews)
0.0
Bhopalmacro

I am working with powershell since 2 years and good at powershell and also i had done the same earlier. I will do the same if get the chance.

$49 USD in 3 days
(0 Reviews)
0.0
itzirfanofficial

I can easily do this for you. You need to trust me with this. I am currently working as an automation engineer using primarily powershell script.

$15 USD in 1 day
(0 Reviews)
0.0
mariohanske

Windows Expert to deploy/configure Windows 10 Relevant Skills and Experience PowerShell

$35 USD in 10 days
(0 Reviews)
0.0
ksp506

I have 5 + years experience in Powershell scripting in various activities like older files, size based documents, type of doc , based on Author and date modified, duplicate files removing or move them to different pl More

$66 USD in 3 days
(0 Reviews)
0.0
Abhigrover

Hiiii,, The requirement is interesting and I would to work on this one. I am sure I can make this script in PowerShell, I have already completed this kind or even more complex type of scripts in my office life. I am a More

$35 USD in 4 days
(0 Reviews)
0.0