This PowerShell script will check the system PATH variable and the user PATH variable for duplicates and then remove any duplicates found.
The script is NOT lazy - it actually checks each environmental variable separately, NOT simply $ENV:PATH
.
Enjoy! 😊️️❤
You can also install this script by typing...
Install-Script -Name Remove-DuplicatesFromPathVariables
As available on PowerShell Gallery.