PowerShell / PSDesiredStateConfiguration

Source for https://www.powershellgallery.com/packages/PSDesiredStateConfiguration module
MIT License
58 stars 14 forks source link

Get-DscResource doesn't identify the class based DSC resource #117

Open bagajjal opened 2 years ago

bagajjal commented 2 years ago

Prerequisites

Steps to reproduce

Get-DscResource doesn't show class-based DSC resources if the PSD1 has all of these CmdletsToExport, FunctionsToExport, AliasesToExport. To mitigate the issues, one of them has to be commented. This is a bug introduced during the PowerShell performance related changes. Andrew Menagarishvili has looked into the code and confirmed this bug.

Expected behavior

Get-DscResources should return DSC resources

Actual behavior

Get-DscResource doesn't show the DSC resource

Error details

No error.

Environment data

Observed with OpenSSH V7.1+.

Visuals

Get-DSCResource doesn't show the class-based DSC resource

image

With workaround by commenting functionsToExport, Get-DscResource shows the class-based DSC Resource

image

anmenaga commented 2 years ago

Possible temporary workarounds until the bug is fixed: 1) comment out any of CmdletsToExport / FunctionsToExport / AliasesToExport (for example, it it is an empty array) 2) specify a wildcard for any of CmdletsToExport / FunctionsToExport / AliasesToExport

raandree commented 1 year ago

I have just experiences the issue and it took some time to find out what it was caused by that bug. Are there plans to fix it?

ThomasNieto commented 1 year ago

Related/Duplicate https://github.com/PowerShell/PSDesiredStateConfiguration/issues/101