DSC
DSC copied to clipboard
PS Adapter Export does not serialize enums correctly
Prerequisites
- [x] Write a descriptive title.
- [x] Make sure you are able to repro it on the latest version
- [x] Search the existing issues.
Summary
I've added the static Export() method to my class-based resources and have Ensure as an enum. When running dsc export the enum gets converted into the numeric value instead of the string value.
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
contentVersion: 1.0.0
resources:
- type: AnyPackageDsc/Package
name: AnyPackageDsc/Package-0
properties:
result:
- Version: 3.12.2140.44225
Prerelease: false
Provider: AnyPackage.Msi\Msi
Source: C:\WINDOWS\Installer\3fc3c86b.msi
Latest: false
Ensure: 1
Name: Microsoft Visual Studio Setup WMI Provider
Reasons: null
AdditionalParameters: {}
Steps to reproduce
Create DSC class based resource with an enum.
Expected behavior
Enums use the string value
Actual behavior
Enums use the numeric value
Error details
Environment data
7.6-preview 4
Version
3.0.1
Visuals
No response
@ThomasNieto I just submitted a pull request. If you're interested in what was changed, you can always check it out at the above link.
@ThomasNieto I think this is fixed in preview.6.