dlwyatt / PolicyFileEditor

PowerShell functions and DSC resource wrappers around the TJX.PolFileEditor.PolFile .NET class.
Apache License 2.0
189 stars 33 forks source link

Fix forward slash in $valueName #3

Closed erwinwildenburg closed 7 years ago

erwinwildenburg commented 7 years ago

The following DSC code doesn't work because there are forward slashes in the KeyValueName:

cAdministrativeTemplateSetting test
{
        Ensure = "Present"
        PolicyType = "Machine"
        KeyValueName = "Software\Policies\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMapKey\https://*.example.com"
        Type = "String"
        Data = "2"
}

The code before this change split the above code in the following:

$key       = "Software\Policies\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMapKey\https:\"
$valueName = "*.example.com"

But it should be:

$key       = "Software\Policies\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMapKey"
$valueName = "https://*.example.com"
dlwyatt commented 7 years ago

Thanks!