Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix quotes in inner dsc block #36

Merged
merged 1 commit into from
Jun 5, 2024
Merged

Fix quotes in inner dsc block #36

merged 1 commit into from
Jun 5, 2024

Conversation

FabienTschanz
Copy link
Contributor

@FabienTschanz FabienTschanz commented May 2, 2024

@NikCharlebois

This pull request fixes an issue where in the inner DSC block (specified by ParameterName) were quotes for value specification, e.g. from XML. If quotes were present inside the block, they were removed as well, and not only the "surrounding" quotes necessary for the DSC block to create.

Example input:

IntuneDeviceConfigurationCustomPolicyWindows10 "IntuneDeviceConfigurationCustomPolicyWindows10-Intune-P-WinAll-ConfProf-Cust-Collaboration-Surface-Hub"
{
    ApplicationId         = `$ConfigurationData.NonNodeData.ApplicationId;
    OmaSettings           = @("
        MSFT_MicrosoftGraphomaSetting{
            Description = 'LAN Profile'
            FileName = 'Lan_Setting_SurfaceHub.xml'
            OmaUri = './Vendor/MSFT/SurfaceHub/Dot3/LanProfile'
            Value = '<?xml version="1.0"?>
<LANProfile xmlns="http://www.microsoft.com/networking/LAN/profile/v1">
    <MSM>
        <security>
            <OneXEnforced>false</OneXEnforced>
            <OneXEnabled>true</OneXEnabled>
            <OneX xmlns="http://www.microsoft.com/networking/OneX/v1">
                <maxAuthFailures>1</maxAuthFailures>
                <authMode>machine</authMode>
                <EAPConfig><EapHostConfig xmlns="http://www.microsoft.com/provisioning/EapHostConfig"><EapMethod><Type xmlns="http://www.microsoft.com/provisioning/EapCommon">13</Type><VendorId xmlns="http://www.microsoft.com/provisioning/EapCommon">0</VendorId><VendorType
xmlns="http://www.microsoft.com/provisioning/EapCommon">0</VendorType><AuthorId xmlns="http://www.microsoft.com/provisioning/EapCommon">0</AuthorId></EapMethod><Config xmlns="http://www.microsoft.com/provisioning/EapHostConfig"><Eap
xmlns="http://www.microsoft.com/provisioning/BaseEapConnectionPropertiesV1"><Type>13</Type><EapType
xmlns="http://www.microsoft.com/provisioning/EapTlsConnectionPropertiesV1"><CredentialsSource><CertificateStore><SimpleCertSelection>true</SimpleCertSelection></CertificateStore></CredentialsSource><ServerValidation><DisableUserPromptForServerValidation>false</DisableUserPromptF
orServerValidation><ServerNames></ServerNames></ServerValidation><DifferentUsername>false</DifferentUsername><PerformServerValidation xmlns="http://www.microsoft.com/provisioning/EapTlsConnectionPropertiesV2">true</PerformServerValidation><AcceptServerName
xmlns="http://www.microsoft.com/provisioning/EapTlsConnectionPropertiesV2">false</AcceptServerName></EapType></Eap></Config></EapHostConfig></EAPConfig>
            </OneX>
        </security>
    </MSM>
</LANProfile>
'
            odataType = '#microsoft.graph.omaSettingStringXml'
            IsEncrypted = `$False
            DisplayName = 'LAN Profile'
        }
    ");
    SupportsScopeTags     = `$True;
    TenantId              = `$OrganizationName;
}

This resulted in the following output for the Value property. See the missing quotes, e.g. after xmlns=http instead of xmlns="http...":

<?xml version=1.0?>
<LANProfile xmlns=http://www.microsoft.com/networking/LAN/profile/v1>
    <MSM>
        <security>
            <OneXEnforced>false</OneXEnforced>
            <OneXEnabled>true</OneXEnabled>
            <OneX xmlns=http://www.microsoft.com/networking/OneX/v1>
                <maxAuthFailures>1</maxAuthFailures>
                <authMode>machine</authMode>
                <EAPConfig><EapHostConfig xmlns=http://www.microsoft.com/provisioning/EapHostConfig><EapMethod><Type xmlns=http://www.microsoft.com/provisioning/EapCommon>13</Type><VendorId xmlns=http://www.microsoft.com/provisioning/EapCommon>0</VendorId><VendorType
xmlns=http://www.microsoft.com/provisioning/EapCommon>0</VendorType><AuthorId xmlns=http://www.microsoft.com/provisioning/EapCommon>0</AuthorId></EapMethod><Config xmlns=http://www.microsoft.com/provisioning/EapHostConfig><Eap
xmlns=http://www.microsoft.com/provisioning/BaseEapConnectionPropertiesV1><Type>13</Type><EapType
xmlns=http://www.microsoft.com/provisioning/EapTlsConnectionPropertiesV1><CredentialsSource><CertificateStore><SimpleCertSelection>true</SimpleCertSelection></CertificateStore></CredentialsSource><ServerValidation><DisableUserPromptForServerValidation>false</DisableUserPromptF
orServerValidation><ServerNames></ServerNames></ServerValidation><DifferentUsername>false</DifferentUsername><PerformServerValidation xmlns=http://www.microsoft.com/provisioning/EapTlsConnectionPropertiesV2>true</PerformServerValidation><AcceptServerName
xmlns=http://www.microsoft.com/provisioning/EapTlsConnectionPropertiesV2>false</AcceptServerName></EapType></Eap></Config></EapHostConfig></EAPConfig>
            </OneX>
        </security>
    </MSM>
</LANProfile>

This change is Reviewable

@FabienTschanz
Copy link
Contributor Author

@NikCharlebois Is there any ETA on the pull request? Just for information, as I know that such changes take time.

@NikCharlebois NikCharlebois merged commit 7692d11 into microsoft:master Jun 5, 2024
1 check passed
@FabienTschanz FabienTschanz deleted the fix/exclude-inner-double-quotes branch June 5, 2024 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants