Author Posts

February 16, 2016 at 2:16 am

Hello,

When I install any module from the PSGallery such as Get-Module xExchange, or XPSReboot, PowerShellCookBook, etc, the show up twice and I don't know why.

If I view the properties both entries are 100% identical (used compare object)

This is causing issues when trying to use a DSC resource because it tells me there are multiple version and it wants me to declare the version, however both version are the same.

Windows 10 Build 14257.rs1
v5.0.14257.1000

February 16, 2016 at 4:58 am

What do you get when you run this? Get-Module xExchange -ListAvailable

March 17, 2016 at 12:12 am

It's been awhile so wanted to get this issue resolved. Here is the output. Its very annoying even if I delete and then re-run it keeps thinking there are two when there is clearly only 1 and they are the same.

Find-Module xExchange | Install-Module

Module Path
C:\Program Files\WindowsPowerShell\Modules\xExchange\1.6.0.0

Multple versions of the module 'xExchange' were found. You can run 'Get-Module -ListAvaliable -FullyQualifiedName xExchange' to see available versionf on the system, and then use fully qualified name '@{ModuleName="xExchange"; RequiredVersion="Version'}'.

PS C:\> Get-Module -ListAvailable -FullyQualifiedName xExchange | Select Name,Version,modulebase

Name Version ModuleBase
—- ——- ———-
xExchange 1.6.0.0 C:\Program Files\WindowsPowerShell\Modules\xExchange\1.6.0.0
xExchange 1.6.0.0 C:\Program Files\WindowsPowerShell\Modules\xExchange\1.6.0.0

March 17, 2016 at 4:46 am

There have been some similar emails on the MVP list lately, and we think it's due to duplicate entries in the PSModulePath variable, along with PowerShell not properly normalizing and deduplicating those paths.

I believe this will be fixed in a future release of PowerShell, but in the meantime, what's in your $env:PSModulePath ?

August 17, 2016 at 10:57 pm

Thanks Dave. Had the same issue. Turned out the ModulePath was listed more than once in $env:PSModulePath.

August 22, 2016 at 4:29 pm

Any further word on this? It's been happening to me on several servers. When it does and I try to apply a DSC config, it errors out because it's finding the modules too many times.

What's worse is that I know I have fixed this by manually editing the path, but the problem came back. I don't know what's putting it back, unless it's something from a Windows Update.