dscr-for-vmware icon indicating copy to clipboard operation
dscr-for-vmware copied to clipboard

PSv7 and VMware.vSphereDSC and Get-DscResource

Open lucdekens opened this issue 4 years ago • 3 comments

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?

lucdekens avatar Aug 31 '20 19:08 lucdekens

We are currently looking into this issue and researching it.

KristiyanGK avatar Sep 01 '20 06:09 KristiyanGK

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.

lucdekens avatar Sep 01 '20 10:09 lucdekens

@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 ?

SimeonGerginov avatar Sep 03 '20 12:09 SimeonGerginov