microsoft / EntraExporter

PowerShell module to export a local copy of an Entra (Azure AD) tenant configuration.
https://aka.ms/EntraExporter
MIT License
568 stars 89 forks source link

PropertyNotFoundException: The property 'Path' cannot be found on this object. #70

Closed SamErde closed 2 months ago

SamErde commented 2 months ago

PR #69 causes PropertyNotFoundException on lines 103, 108, 149, and 150.

This is caused by a missing Path attribute for the Teams object in Get-EEDefaultSchema.ps1.

This output occurs when using the All, Config, or Teams tags.

C:\Temp> Export-Entra -Type Teams -Path 'C:\Temp\EntraExporter\Teams'
PropertyNotFoundException: C:\Users\sturd\Repositories\Public\EntraExporter\src\Export-Entra.ps1:103
Line |
 103 |              $outputFileName = Join-Path -Path $Path -ChildPath $item. …
     |              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | The property 'Path' cannot be found on this object. Verify that the property exists.
PropertyNotFoundException: C:\Users\sturd\Repositories\Public\EntraExporter\src\Export-Entra.ps1:108
Line |
 108 |              Write-Host "$spacer $($item.Path)"
     |                                    ~~~~~~~~~~
     | The property 'Path' cannot be found on this object. Verify that the property exists.

Join-Path: C:\Users\sturd\Repositories\Public\EntraExporter\src\Export-Entra.ps1:149
Line |
 149 |  …         $itemOutputFileName = Join-Path -Path $outputFileName -ChildP …
     |                                                  ~~~~~~~~~~~~~~~
     | Cannot bind argument to parameter 'Path' because it is null.
Join-Path: C:\Users\sturd\Repositories\Public\EntraExporter\src\Export-Entra.ps1:150
Line |
 150 |  …         $parentOutputFileName = Join-Path $itemOutputFileName -ChildP …
     |                                              ~~~~~~~~~~~~~~~~~~~
     | Cannot bind argument to parameter 'Path' because it is null.