PSDesiredStateConfiguration
PSDesiredStateConfiguration copied to clipboard
Enable `export` for class-based resources
Summary of the new feature / enhancement
Enable class-based resources to participate in DSCv3 export capability
Proposed technical implementation details (optional)
No response
The PowerShell adapter for DSCv3 is implemented to support export for PSDSC Resources when the resource has a static Export method that takes no parameters and returns an array of the PSDSC Resource class.
https://github.com/PowerShell/DSC/blob/0157276b2ada32da5859ce930f4cae2e592f586c/powershell-adapter/psDscAdapter/psDscAdapter.psm1#L296-L301
Following is an example signature for the Export method, using MyDscResource as the class name:
static [MyDscResource[]] Export() {
# Code to return the array of all instances for the resource
}
However, the PSDesiredStateConfiguration module doesn't know about or handle the Export method at all.