IntuneDeviceConfigurationAdministrativeTemplatePolicyWindows10: Error parsing DSC configuration to HTML Report
Description of the issue
When generating an HTML Report from IntuneDeviceConfigurationAdministrativeTemplatePolicyWindows10 DSC Configuration it throws an error:
ConvertTo-DSCObject : Error parsing DSC configuration: Exception calling "ConvertToDscObject" with "4" argument(s):
"Error parsing configuration: Missing '=' operator after key in property assignment."
At C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.26.422.1\Modules\M365DSCReport.psm1:1895 char:22
+ $parsedContent = ConvertTo-DSCObject @params
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,ConvertTo-DSCObject
Exception calling "ConvertToDscObject" with "4" argument(s): "Error parsing configuration: Missing '=' operator after
key in property assignment."
At C:\Program Files\WindowsPowerShell\Modules\DSCParser\3.0.0.4\DSCParser.psm1:164 char:13
+ $result = [DSCParser.CSharp.DscParser]::ConvertToDscObjec ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : InvalidOperationException
Microsoft 365 DSC Version
1.26.422.1
Which workloads are affected
Intune
The DSC configuration
I would rather not share the ps1 config file publicly
Verbose logs showing the problem
ConvertTo-DSCObject : Error parsing DSC configuration: Exception calling "ConvertToDscObject" with "4" argument(s):
"Error parsing configuration: Missing '=' operator after key in property assignment."
At C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.26.422.1\Modules\M365DSCReport.psm1:1895 char:22
+ $parsedContent = ConvertTo-DSCObject @params
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,ConvertTo-DSCObject
Exception calling "ConvertToDscObject" with "4" argument(s): "Error parsing configuration: Missing '=' operator after
key in property assignment."
At C:\Program Files\WindowsPowerShell\Modules\DSCParser\3.0.0.4\DSCParser.psm1:164 char:13
+ $result = [DSCParser.CSharp.DscParser]::ConvertToDscObjec ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : InvalidOperationException
Environment Information + PowerShell Version
OsName : Microsoft Windows Server 2022 Datacenter Azure Edition
OsOperatingSystemSKU : 407
OsArchitecture : 64-bit
WindowsVersion : 2009
WindowsBuildLabEx : 20348.1.amd64fre.fe_release.210507-1500
OsLanguage : en-US
OsMuiLanguages : {en-US}
Key : PSVersion
Value : 5.1.20348.4294
Name : PSVersion
Key : PSEdition
Value : Desktop
Name : PSEdition
Key : PSCompatibleVersions
Value : {1.0, 2.0, 3.0, 4.0...}
Name : PSCompatibleVersions
Key : BuildVersion
Value : 10.0.20348.4294
Name : BuildVersion
Key : CLRVersion
Value : 4.0.30319.42000
Name : CLRVersion
Key : WSManStackVersion
Value : 3.0
Name : WSManStackVersion
Key : PSRemotingProtocolVersion
Value : 2.3
Name : PSRemotingProtocolVersion
Key : SerializationVersion
Value : 1.1.0.1
Name : SerializationVersion
@jan-kre If you could at least share the part of the config where the error appears, that would be great. Or you can send me a private notification on LinkedIn. Without the config, we won't be able to reproduce the issue you have. Thanks.
@jan-kre After the next release when you do a new export, the property won't be shown anymore. Unfortunately we can't fix the current configuration - You'll either have to remove the Value = definitions yourself or do a new export.
@FabienTschanz Thank you
I manually imported the modified psm and tested it - it works now