diff --git a/SamplesV2/ContinuousIntegrationAndDelivery/PrePostDeploymentScript.Ver2.ps1 b/SamplesV2/ContinuousIntegrationAndDelivery/PrePostDeploymentScript.Ver2.ps1 index ab8cc879..7d12c8ba 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 } }