VMware Cloud Community
jvm2016
Hot Shot
Hot Shot
Jump to solution

import-module vmware.vimautomation.core

hi Luc,

good morning

if you could suggest on the following error which i got running the below function .

though its not the proper function structure but it will allow users to update powercli online .

pastedImage_0.png

pastedImage_1.png

Reply
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Did you already try adding the -Force switch on the Import-Module cmdlet?

Another option could be to first run Uninstall-Module and then replacing the Update-Module with an Install-Module


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

Reply
0 Kudos
10 Replies
LucD
Leadership
Leadership
Jump to solution

Did you already try adding the -Force switch on the Import-Module cmdlet?

Another option could be to first run Uninstall-Module and then replacing the Update-Module with an Install-Module


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
jvm2016
Hot Shot
Hot Shot
Jump to solution

i can see vmware.vimautomation.core from 11.2 and 11.5 .is this the cause of error??

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

No, you have multiple versions of a module installed.

PowerShell will take the latest version.

I suspect that load error has to do with a module that is already loaded.

Loading a module also includes loading types that come with the module.

The DLLs containing those type definitions might be cached in the GAC.


The best way to fix this is to restart your PowerShell session, but that might be a problem in this situation.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
jvm2016
Hot Shot
Hot Shot
Jump to solution

iam checking this...

Reply
0 Kudos
jvm2016
Hot Shot
Hot Shot
Jump to solution

i used the force switch as yu suggested and it is working

pastedImage_0.png

Reply
0 Kudos
jvm2016
Hot Shot
Hot Shot
Jump to solution

Hi Luc,

just thought of asking if update-module vmware.powercli will update to 11.5 version from powershell gallery??

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

Yes, the current latest version from the Gallery.

Currently 11.5


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
jvm2016
Hot Shot
Hot Shot
Jump to solution

Thanks  Luc,

i have one scenrio below wherein i wan to update powercli .

i have seen in some environments where in version 6.x.x.x  coexist with 11.5 .

if i try to update-module vmware.powercli on this system (considering online ) will it be possile to update to 11.5 withput unintalling below modules .

uninstallation is not wotking as its prompting to source file which is not availble .

pastedImage_0.png

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

When PowerCLI moved to the PowerShell Gallery they abandoned the installation EXE.

Installations done with such an EXE (up to 6.5 R1) need to be uninstalled before attempting to install PowerCLI modules from the Gallery.

And yes, to uninstall such an EXE install, the msiexec needs access to the msi files.

PowerCLI 6.5 R1 (and earlier) can NOT coexist with 6.5.1 (and later).


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
jvm2016
Hot Shot
Hot Shot
Jump to solution

tx

Reply
0 Kudos