powershell env:PSModulepath duplicate records Winserv 2016 TP4

I was testing some xAzure DSC configuration stuff on my Windows Server 2016 TP4 and noticed that when I was trying to use the resource it said that duplicate modules was found but I could not find any in the powershell module libraries and thus it ought to be something else,

I found the tweet that Ben Gelens sent pointing me to the $env:psmodulepath

Screen Shot 2016-03-23 at 22.02.29

So looking in my psmodulepath I could see that I had two records that was the same and that had to be fixed,

Screen Shot 2016-03-23 at 14.48.58

So to remove the duplicate I first remove both and then add the one again:

Screen Shot 2016-03-23 at 14.49.52

$env:PSModulePath = $env:PSModulePath –replace “;C:\\Program Files\\WindowsPowerShell\\Modules”

Screen Shot 2016-03-23 at 14.52.54

$env:PSModulePath = $env:PSModulePath + “;C:\Program Files\WindowsPowerShell\Modules”

Happy automating 🙂