You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 24, 2021. It is now read-only.
Description: There seems to be a problem when having base classes for DSC Resources you want to reuse. The problem occurs when having the 'Using module' clause, if you define the base class in the same file, no error is thrown. However, this way you cannot reuse base classes for multiple DSC Resources.
Full Example:
BaseDSC class is defined in a separate module 'Base'.
The problem only occurs when calling Get-DscResource in the same process as Import-Module. If we Import the module in one process and call Get-DscResource in another, the error does not occur.
The text was updated successfully, but these errors were encountered:
I'm afraid that's not a bug from a DSC Resource of the Resources Kit, but a PowerShell one.
As you are using Windows PowerShell, your best bet is probably to open a support request with Microsoft, but not sure it'd go very far.
If you can reproduce on PS Core, you might want to file it on the PowerShell/PowerShell github repository.
Hi @SimeonGerginov,
I struggle to reproduce your error.
Could you please let me know what's your $PSversionTable.PSVersion
Also do a get-module -listAvailable PSDesiredStateConfiguration (could be my environment that has been altered).
Could you provide a repository with the modules and tests you run?
Well based on your example I get the impression that ClassRsrcWithSubType2 is a Class based DSC Resource but in my case BaseDSC is not a DSC Resource. It is a PowerShell class only that is then extended by the DSC Resources. So that may be the reason why the error is not reproduced.
P.S. If the bug is still not reproduced, I will provide an example module with more details.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
bugThe issue is a bug.externalThe issue cannot be resolved within the DSC Resource Kit.
Description: There seems to be a problem when having base classes for DSC Resources you want to reuse. The problem occurs when having the 'Using module' clause, if you define the base class in the same file, no error is thrown. However, this way you cannot reuse base classes for multiple DSC Resources.
Full Example:
BaseDSC class is defined in a separate module 'Base'.
With 'Using module' I import it in the Resource module:
When you import the module and call Get-DscResource:
The following error is thrown:
The problem only occurs when calling Get-DscResource in the same process as Import-Module. If we Import the module in one process and call Get-DscResource in another, the error does not occur.
The text was updated successfully, but these errors were encountered: