From 87cd66b6e1b419b121123dd9b74ac98a413e78e3 Mon Sep 17 00:00:00 2001 From: Aurel Schwitter Date: Thu, 23 Feb 2023 17:03:40 +0100 Subject: [PATCH] Fix wrong or logic in statement --- .../PrePostDeploymentScript.Ver2.ps1 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/SamplesV2/ContinuousIntegrationAndDelivery/PrePostDeploymentScript.Ver2.ps1 b/SamplesV2/ContinuousIntegrationAndDelivery/PrePostDeploymentScript.Ver2.ps1 index ab8cc879..5a726905 100644 --- a/SamplesV2/ContinuousIntegrationAndDelivery/PrePostDeploymentScript.Ver2.ps1 +++ b/SamplesV2/ContinuousIntegrationAndDelivery/PrePostDeploymentScript.Ver2.ps1 @@ -427,8 +427,9 @@ function Compare-TriggerPipelineReference { } else { $deployedValueObj = ConvertFrom-Json $deployedValue.ToString() $payloadValueObj = ConvertFrom-Json $payloadValue.ToString() - # when both are null, do not compare them - if ($null -ne $deployedValueObj -and $null -ne $payloadValueObj) { + # only compare the objects when one of them is non-null + if ($null -ne $deployedValueObj -or $null -ne $payloadValueObj) { + } $paramValueChanges = Compare-Object -ReferenceObject $deployedValueObj -DifferenceObject $payloadValueObj } }