Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
5 tasks done
bagajjal opened this issue Jan 14, 2022 · 3 comments
Open
5 tasks done

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

bagajjal opened this issue Jan 14, 2022 · 3 comments

Comments

@bagajjal
Copy link
Collaborator

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
Copy link
Collaborator

anmenaga commented Mar 8, 2022

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
Copy link

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?

johlju referenced this issue in dsccommunity/JeaDsc May 15, 2023
- Removed unnecessary entries in module manifest because of this [bug in PowerShell](https://github.com/PowerShell/PowerShell/issues/16750).
@ThomasNieto
Copy link

Related/Duplicate #101

@SteveL-MSFT SteveL-MSFT transferred this issue from PowerShell/PowerShell Aug 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants