If a condition if passed to Write-DSCString two empty if() statements are passed to the configuration script for each block.
You get a structure as follows:
if()
{
} if() {
}
It looks like the order of code used in Write-DSCString when a condition is passed is partially to blame as well as the code for the condition variable. THe one I encountered came from Internetsettings.ps1
$Condition = [scriptblock]"`$InternetExplorerVersion -eq $($XML.ParentNode.ParentNode.Name)"
If you run this you get a message that PS cannot convert a string to a script block. I managed to get around this by doing
$Condition = $executionContext.invokeCommand.NewScriptBlock("`$InternetExplorerVersion -eq `"$($XML.ParentNode.ParentNode.Name)`"")
If a condition if passed to Write-DSCString two empty if() statements are passed to the configuration script for each block.
You get a structure as follows: if() {