benmeadowcroft / SRM-Cmdlets

Helper functions for working with SRM and PowerCLI
Apache License 2.0
17 stars 7 forks source link

VMWare.VimAutomation.Srm module is not loaded #20

Closed flegmatoid closed 6 years ago

flegmatoid commented 6 years ago

I'm using 6.5 R1

Upon importing Meadowcroft.Srm.psd1 I get the error message that VMWare.VimAutomation.Srm module is not loaded. I don't seem to find it among PowerCLI modules either. Couple of SRM *.dll's seem to exist under VMWare.Vim.Automation.Core, but loading .Core has no effect on the error. Bypassing this and directly importing the .psm1 goes well, but Get-SrmConfigReport (from the example) fails with [VMware.VimAutomation.Srm.Types.V1.SrmServer[ - make sure that module containing this type is loaded.

benmeadowcroft commented 6 years ago

I'm using 6.5 R1

The minimum supported version of PowerCLI for v0.2 of the cmdlets is actually 6.5.1, this is actually different from 6.5 R1! Very confusing I know.

I would suggest either upgrading to a newer version of PowerCLI available from the Powershell gallery, as described in the PowerCLI blog, or using an earlier version of the cmdlets that supported earlier versions of PowerCLI.

Bypassing this and directly importing the .psm1 goes well, but Get-SrmConfigReport (from the example) fails with [VMware.VimAutomation.Srm.Types.V1.SrmServer[ - make sure that module containing this type is loaded.

The bypass "works" because it skips the required modules check in the module descriptor. Because PowerCLI changed their SRM module in 6.5.1 so that different types were now used, the cmdlets themselves had to be updated to use the new types. This leads to the missing type issue you observed. I wrote a little bit about these changes on my blog post announcing the new release.

Thank you very much for sharing your report.