Skip to content

Commit

Permalink
add fallback for failing ListModulesInDependencyOrder
Browse files Browse the repository at this point in the history
#753

See also #745
  • Loading branch information
FH-Inway committed Oct 14, 2023
1 parent 2f8fbdd commit 62809a0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion d365fo.tools/functions/get-d365module.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,12 @@ function Get-D365Module {

Write-PSFMessage -Level Verbose -Message "MetadataProvider initialized." -Target $metadataProviderViaDisk

$diskModules = $metadataProviderViaDisk.ModelManifest.ListModulesInDependencyOrder()
try {
$diskModules = $metadataProviderViaDisk.ModelManifest.ListModulesInDependencyOrder()
} catch {
Write-PSFMessage -Level Warning -Message "Failed to retrieve disk modules in dependency order. Falling back to ListModules()." -Target $metadataProviderViaDisk
$diskModules = $metadataProviderViaDisk.ModelManifest.ListModules()
}

foreach ($module in $modules) {
if ($diskModules.Name -NotContains $module.Name) {
Expand Down

0 comments on commit 62809a0

Please sign in to comment.