Skip to content

Commit

Permalink
Merge pull request #762 from FH-Inway/fix-get-d365module
Browse files Browse the repository at this point in the history
add fallback for failing ListModulesInDependencyOrder
  • Loading branch information
Splaxi authored Oct 16, 2023
2 parents 9094561 + 62809a0 commit f190ead
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 f190ead

Please sign in to comment.