vmware / dscr-for-vmware

The Repository contains Microsoft PowerShell Desired State Configuration (DSC) Resources for managing VC and ESXi settings.
Other
139 stars 41 forks source link

PSv7 and VMware.vSphereDSC and Get-DscResource #274

Open lucdekens opened 4 years ago

lucdekens commented 4 years ago

While trying to use the Invoke-DscResource cmdlet on a Linux box, I noticed that the resources for one reason or another are not found.

On PSv7 on a Windows box the Get-DscResource cmdlet only lists the composite resources (3). On a Linux box (Ubuntu & Photon) with PSv7, the Get-DscResource cmdlet returns nothing.

According to PowerShell issue#10350 the Get-DscResource cmdlet should return class-based resources.

Is this a known issue? Anything specific to VMware.vSPhereDSC?

KristiyanGK commented 4 years ago

We are currently looking into this issue and researching it.

lucdekens commented 4 years ago

Btw, the Invoke-DscResource cmdlet also has issues in PSv5.1.

With the composite resources it errors out with

Invoke-DscResource : Failed to serialize properties into CimInstance.

which is an old known issue. See Invoke-DSCResource on WindowsFeatureSet fails.

And with non-composite resources it errors out with

The PowerShell DSC resource VMHostRole from module <VMware.vSphereDSC,2.1.0.58> does not exist at the PowerShell module path nor is it registered as a WMI DSC resource.

All in all, it looks as if Invoke-DscResource is a no-go for now.

SimeonGerginov commented 4 years ago

@lucdekens the issue seems to be the same as the one described here. We've verified the workaround provided there: To comment FunctionsToExport and it works as expected on PSv7 on a Windows box.

Can you confirm that it works as well on your boxes ?