From 9db2565f74ba2a9280c3ee43fbb97f5f85d7e83b Mon Sep 17 00:00:00 2001 From: Thomas Nieto <38873752+ThomasNieto@users.noreply.github.com> Date: Fri, 9 May 2025 23:44:22 -0500 Subject: [PATCH] Fix source test when set to absent --- src/AnyPackageDsc.psm1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/AnyPackageDsc.psm1 b/src/AnyPackageDsc.psm1 index ac101d9..ac16b5d 100644 --- a/src/AnyPackageDsc.psm1 +++ b/src/AnyPackageDsc.psm1 @@ -197,7 +197,7 @@ class Source { [DscProperty(Key)] [string] $Provider - [DscProperty(Mandatory)] + [DscProperty()] [string] $Location [DscProperty()] @@ -265,7 +265,7 @@ class Source { } } - if ($this.Location -ne $currentState.Location) { + if ($this.Location -and $this.Location -ne $currentState.Location) { $currentState.Reasons += [APReason]@{ Code = 'Source:Source:Location' Phrase = "Location should be '$($this.Location)' but was '$($currentState.Location)'."