Hi @SAMUEL VALAPARLA ,
the if($LatestGPLog)
is true if the variable $LatestGPLog
contains "something", which means $LatestGPLog
is "not Null" or "is not empty".
Instead of if($LatestGPLog)
you can use if($LatestGPLog -ne $null)
The opposite of if($LatestGPLog)
- "variable is not Null" is if(!$LatestGPLog)
- variable is "!empty or null"
Or if($LatestGPLog -eq $null)
----------
(If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)
Regards
Andreas Baumgarten