Microsoft365DSC icon indicating copy to clipboard operation
Microsoft365DSC copied to clipboard

Report Error-Duplicate keys 'name' are not allowed in hash literals.

Open Aussupport opened this issue 6 months ago • 6 comments

Description of the issue

New-M365DSCReportFromConfiguration -Type HTML -ConfigurationPath C:\M365\M365DSc-SC10062025.ps1 -OutputPath C:\M365\Report\M365DSc-SC10062025.html

There is a newer version of the 'Microsoft365DSC' module available on the gallery. To update the module and it's dependencies, run the following command: Update-M365DSCModule Error parsing configuration: At line:2610 char:25

  •                     name = @(
    
  •                     ~~~~
    

Duplicate keys 'name' are not allowed in hash literals. At C:\Program Files\WindowsPowerShell\Modules\DSCParser\2.0.0.17\Modules\DSCParser.psm1:472 char:9

  •     throw "$($errorPrefix)Error parsing configuration: $parseErro ...
    
  •     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : OperationStopped: (Error parsing c... hash literals.:String) [], RuntimeException
    • FullyQualifiedErrorId : Error parsing configuration: At line:2610 char:25
  •                     name = @(
    
  •                     ~~~~
    

Duplicate keys 'name' are not allowed in hash literals.

Microsoft 365 DSC Version

1.25.528.1

Which workloads are affected

Security & Compliance Center

The DSC configuration

New-M365DSCReportFromConfiguration -Type HTML -ConfigurationPath C:\M365\M365DSc-SC10062025.ps1 -OutputPath C:\M365\Report\M365DSc-SC10062025.html

Verbose logs showing the problem

Duplicate keys 'name' are not allowed in hash literals.

Environment Information + PowerShell Version

OsName               : Microsoft Windows Server 2022 Datacenter
OsOperatingSystemSKU : DatacenterServerEdition
OsArchitecture       : 64-bit
WindowsVersion       : 2009
WindowsBuildLabEx    : 20348.1.amd64fre.fe_release.210507-1500
OsLanguage           : en-US
OsMuiLanguages       : {en-US}

$PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.20348.2849
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.20348.2849
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Aussupport avatar Jun 10 '25 06:06 Aussupport

@Aussupport Can you share the part of the configuration where the error appears?

FabienTschanz avatar Jun 10 '25 17:06 FabienTschanz

               ContentContainsSensitiveInformation = MSFT_SCDLPContainsSensitiveInformation{
            groups = MSFT_SCDLPContainsSensitiveInformationGroup{
                operator = "Or"
                labels = MSFT_SCDLPLabel{
                    name = @(
                        "Protected"
                        "Protected-Private"
                        "Protected-Commercial"
                        "Protected-Legal"
                        "Protected-Other"
                    )
                    id = @(
                        "c00a4903-f6b0-454a-8640-5a4dc7bd07ff"
                        "10ac1077-cbd9-4e91-8ead-ddcbcaf43cb8"
                        "c76c57e2-53c7-4f65-90c1-dbca2754a363"
                        "00319cda-4cf0-44c1-ad04-a52bf8f128df"
                        "0365abee-b922-4f3a-990d-0173ea38bb86"
                    )
                    type = @(
                        "Sensitivity"
                        "Sensitivity"
                        "Sensitivity"
                        "Sensitivity"
                        "Sensitivity"
                    )
                    name = @(
                        "Protected"
                        "Protected-Private"
                        "Protected-Commercial"
                        "Protected-Legal"
                        "Protected-Other"
                    )
                    id = @(
                        "c00a4903-f6b0-454a-8640-5a4dc7bd07ff"
                        "10ac1077-cbd9-4e91-8ead-ddcbcaf43cb8"
                        "c76c57e2-53c7-4f65-90c1-dbca2754a363"
                        "00319cda-4cf0-44c1-ad04-a52bf8f128df"
                        "0365abee-b922-4f3a-990d-0173ea38bb86"
                    )
                    type = @(
                        "Sensitivity"
                        "Sensitivity"
                        "Sensitivity"
                        "Sensitivity"
                        "Sensitivity"
                                           
                    )
                    id = @(
                        "c00a4903-f6b0-454a-8640-5a4dc7bd07ff"
                        "10ac1077-cbd9-4e91-8ead-ddcbcaf43cb8"
                        "c76c57e2-53c7-4f65-90c1-dbca2754a363"
                        "00319cda-4cf0-44c1-ad04-a52bf8f128df"
                        "0365abee-b922-4f3a-990d-0173ea38bb86"
                    )
                    type = @(
                        "Sensitivity"
                        "Sensitivity"
                        "Sensitivity"
                        "Sensitivity"
                        "Sensitivity"
                    )
                    name = @(
                        "Protected"
                        "Protected-Private"
                        "Protected-Commercial"
                        "Protected-Legal"
                        "Protected-Other"
                    )
                    id = @(
                        "c00a4903-f6b0-454a-8640-5a4dc7bd07ff"
                        "10ac1077-cbd9-4e91-8ead-ddcbcaf43cb8"
                        "c76c57e2-53c7-4f65-90c1-dbca2754a363"
                        "00319cda-4cf0-44c1-ad04-a52bf8f128df"
                        "0365abee-b922-4f3a-990d-0173ea38bb86"
                    )
                    type = @(
                        "Sensitivity"
                        "Sensitivity"
                        "Sensitivity"
                        "Sensitivity"
                        "Sensitivity"
                    )
                    name = @(
                        "Protected"
                        "Protected-Private"
                        "Protected-Commercial"
                        "Protected-Legal"
                        "Protected-Other"
                    )
                    id = @(
                        "c00a4903-f6b0-454a-8640-5a4dc7bd07ff"
                        "10ac1077-cbd9-4e91-8ead-ddcbcaf43cb8"
                        "c76c57e2-53c7-4f65-90c1-dbca2754a363"
                        "00319cda-4cf0-44c1-ad04-a52bf8f128df"
                        "0365abee-b922-4f3a-990d-0173ea38bb86"
                    )
                    type = @(
                        "Sensitivity"
                        "Sensitivity"
                        "Sensitivity"
                        "Sensitivity"
                        "Sensitivity"
                    )
                }
                name = "Default"
            }
            operator = "And"

Aussupport avatar Jun 11 '25 06:06 Aussupport

After removing the duplicate, all sorted.

Aussupport avatar Jun 11 '25 06:06 Aussupport

@Aussupport Thank you for the configuration, that helps a lot. I'll take a look at it later.

FabienTschanz avatar Jun 11 '25 10:06 FabienTschanz

I get this as well - stops SCDLPComplianceRule from exporting to Excel

FlattusBlastus avatar Jun 20 '25 19:06 FlattusBlastus

@Aussupport @FlattusBlastus How do I have to configure the compliance rule in Purview to get a similar export as you? Whatever I do, I am unable to populate the properties for the export. All I have is the information in the AdvancedRule property if I create an advanced one.

I believe this is because https://learn.microsoft.com/en-us/purview/dlp-policy-design#complex-rule-design says that they've overhauled the backend api management of the rules.

FabienTschanz avatar Jun 21 '25 11:06 FabienTschanz

I'm going to close this issue since it seems that the backend was overhauled and previous configurations don't work anymore.

FabienTschanz avatar Jul 24 '25 19:07 FabienTschanz

Please reopen. I updated to current. Still got the dupes.

FlattusBlastus avatar Jul 25 '25 17:07 FlattusBlastus

@FlattusBlastus did you re-export the configuration? If no, does the new export still look the same?

FabienTschanz avatar Jul 26 '25 19:07 FabienTschanz

@FlattusBlastus Any news? Otherwise I'll be closing it again.

FabienTschanz avatar Sep 15 '25 08:09 FabienTschanz

I have the issue uniquely identified. All I can tell you publicly is that it involves case. In order to share more, I would have to send the info from my work email to a microsoft.com account. Better yet, via Teams. My org and MS share a NDA. In order to demonstrate, I'd have to show you some org work product and I just can't do that here. I like my job very much. I have tried asking my customer success rep to pass the info to Nik internally without revealing his internal email address to me but was also denied. I have the info thats needed but cant share it for all to see.

On Mon, Sep 15, 2025 at 1:05 AM Fabien Tschanz @.***> wrote:

FabienTschanz left a comment (microsoft/Microsoft365DSC#6152) https://github.com/microsoft/Microsoft365DSC/issues/6152#issuecomment-3290940308

@FlattusBlastus https://github.com/FlattusBlastus Any news? Otherwise I'll be closing it again.

— Reply to this email directly, view it on GitHub https://github.com/microsoft/Microsoft365DSC/issues/6152#issuecomment-3290940308, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASVVEUFTU7LQ7W5LZIYUWMT3SZXM3AVCNFSM6AAAAAB66YIZVSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTEOJQHE2DAMZQHA . You are receiving this because you were mentioned.Message ID: @.***>

FlattusBlastus avatar Sep 15 '25 13:09 FlattusBlastus

@FlattusBlastus I passed the info to Nik, hope that he'll respond. Unfortunately, I don't work for Microsoft, meaning I probably can't help anymore, except if you can describe what the process is and how I get there without sharing any confidential information. Is that really not possible?

FabienTschanz avatar Sep 15 '25 20:09 FabienTschanz

How were these config generated in the first place. The above example seems incorrect, this is not how the resource's schema is being defined.

NikCharlebois avatar Sep 15 '25 23:09 NikCharlebois

@FlattusBlastus Do you have any information that can help us in investigating? Otherwise we'll have to close it.

FabienTschanz avatar Oct 02 '25 17:10 FabienTschanz

Closing this one as stale. If the issue persists, feel free to reopen it.

FabienTschanz avatar Nov 10 '25 11:11 FabienTschanz