From d711f6be936e4842fdb52a9f6facb125d2eab4e1 Mon Sep 17 00:00:00 2001 From: Florian Hopfner Date: Mon, 4 Mar 2024 16:30:26 +0100 Subject: [PATCH] Fix Compare-BapEnvironmentD365App function to handle missing source versions --- d365bap.tools/functions/Compare-BapEnvironmentD365App.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/d365bap.tools/functions/Compare-BapEnvironmentD365App.ps1 b/d365bap.tools/functions/Compare-BapEnvironmentD365App.ps1 index c31a654..782cf86 100644 --- a/d365bap.tools/functions/Compare-BapEnvironmentD365App.ps1 +++ b/d365bap.tools/functions/Compare-BapEnvironmentD365App.ps1 @@ -116,11 +116,12 @@ function Compare-BapEnvironmentD365App { $resCol = @(foreach ($sourceApp in $($appsSourceEnvironment | Sort-Object -Property ApplicationName )) { $destinationApp = $appsDestinationEnvironment | Where-Object PackageId -eq $sourceApp.PackageId | Select-Object -First 1 + $sourceVersion = if ($sourceApp.InstalledVersion -eq "N/A") { [System.Version]"0.0.0.0" } else { [System.Version]$sourceApp.InstalledVersion } $tmp = [Ordered]@{ PackageId = $sourceApp.PackageId PackageName = $sourceApp.PackageName AppName = $sourceApp.AppName - SourceVersion = [System.Version]$sourceApp.InstalledVersion + SourceVersion = $sourceVersion DestinationVersion = "Missing" }