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

Issue with command ‘New-M365DSCReportFromConfiguration’ - cannot index into null array #5486

Open
RosalindHook opened this issue Nov 29, 2024 · 0 comments

Comments

@RosalindHook
Copy link

Description of the issue

I am trying to produce a report for some of the resources within the AzureAD workload. The reports generated are blank and I am getting the error message attached in this file, i.e. 'Cannot index into a null array'.

Image

Microsoft 365 DSC Version

1.24.1127.1

Which workloads are affected

Azure Active Directory (Entra ID)

The DSC configuration

Run the following to export the required resource (have tried with different resources too also within the AzureAD workload):
 
Export-M365DSCConfiguration -Components @("AADAdministrativeUnit-M365TenantConfig") `
-ApplicationId <my application ID> `
-CertificateThumbprint <my thumbprint> `
-TenantId <my tenant>

Then having checked that there is content in the exported file, run the following:

New-M365DSCReportFromConfiguration -Type Excel -ConfigurationPath C:\Development\M365-DSC\M365TenantConfig.ps1 -OutputPath C:\Development\M365Report.xlsx

An Excel file is generated but with the following fields / no information (the same happens for both HTML and JSON):

Component Name	Property	Value
	ResourceInstanceName	$Null
	ResourceInstanceName	$Null


There is an error log in the console which I have screenshotted above.

Verbose logs showing the problem

Cannot index into a null array.
At C:\Program Files\WindowsPowerShell\Modules\DSCParser\2.0.0.14\Modules\DSCParser.psm1:539 char:9
+         $resourceType         = $resource.CommandElements[0].Value
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : NullArray

Cannot index into a null array.
At C:\Program Files\WindowsPowerShell\Modules\DSCParser\2.0.0.14\Modules\DSCParser.psm1:540 char:9
+         $resourceInstanceName = $resource.CommandElements[1].Value
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : NullArray

Cannot index into a null array.
At C:\Program Files\WindowsPowerShell\Modules\DSCParser\2.0.0.14\Modules\DSCParser.psm1:553 char:35
+ ... foreach ($keyValuePair in $resource.CommandElements[2].KeyValuePairs)
+                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : NullArray

Cannot index into a null array.
At C:\Program Files\WindowsPowerShell\Modules\DSCParser\2.0.0.14\Modules\DSCParser.psm1:539 char:9
+         $resourceType         = $resource.CommandElements[0].Value
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : NullArray

Cannot index into a null array.
At C:\Program Files\WindowsPowerShell\Modules\DSCParser\2.0.0.14\Modules\DSCParser.psm1:540 char:9
+         $resourceInstanceName = $resource.CommandElements[1].Value
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : NullArray

Cannot index into a null array.
At C:\Program Files\WindowsPowerShell\Modules\DSCParser\2.0.0.14\Modules\DSCParser.psm1:553 char:35
+ ... foreach ($keyValuePair in $resource.CommandElements[2].KeyValuePairs)
+                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : NullArray

Environment Information + PowerShell Version

Name                           Value
----                           -----
PSVersion                      5.1.19041.5129
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.19041.5129
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
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

No branches or pull requests

1 participant