allow to specify powershell edition for dsc resource
Description of the new feature / enhancement
I want to use winget configure to change content of existing file. For this i wanted to use ReplaceText resource from FileContentDsc module. But it fails with The configuration unit failed while attempting to test the current system state. Cannot process argument transformation on parameter 'Encoding'. 'byte' is not a supported encoding name. For information on defining a custom encoding, see the documentation for the Encoding.RegisterProvider method. (Parameter 'name') because this resource uses Get-Content -Encoding byte which is not supported in core edition but supported in desktop edition. Adding an option to select powershell edition for resource would allow to reuse existing dsc resource that may be not supported anymore or updated very rarely
Proposed technical implementation details
add new option to resource directives to specify powershell edition to use
- resource: Module/Resource
directives:
powershellEdition: core | desktop
[Policy] PowerShell