Skip to content

Instantly share code, notes, and snippets.

@NReilingh
Last active September 23, 2019 02:35
Show Gist options
  • Save NReilingh/b7c0f79029bd33539d4e958e28c4a95e to your computer and use it in GitHub Desktop.
Save NReilingh/b7c0f79029bd33539d4e958e28c4a95e to your computer and use it in GitHub Desktop.
DSC Configuration data serialized to clixml and then rehydrated doesn't pass this test in PSDesiredStateConfiguration.psm1:1766
$ConfigDataToSerialize = @{
AllNodes = @(
@{
NodeName = 'TestNode1'
}
@{
NodeName = 'TestNode2'
}
)
}
Write-output "Unserialized variable triggers validation error: $($ConfigDataToSerialize.AllNodes -isnot [array])"
Export-Clixml -InputObject $ConfigDataToSerialize -Path .\tempfile.xml
$DeserializedConfigData = Import-CliXml -Path .\tempfile.xml
Write-output "Deserialized variable triggers validation error: $($DeserializedConfigData.AllNodes -isnot [array])"
$ConfigDataToSerialize.AllNodes.GetType()
$DeserializedConfigData.AllNodes.GetType()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment