LeonLaude is right. Sorry I didn't noticed this earlier.
You script stores the result of the WMI query in the variable $CCMupdate
.
Than the logic works on the content of the $CCMupdate
variable and will end up with $true
or $false
You need to write the result in a variable, for instance '$result' and add this variable to the Published Data
of the .Net Activity.
Something like this (not tested):
$CCMUpdate = get-wmiobject -query "SELECT * FROM CCM_SoftwareUpdate" -namespace "ROOT\ccm\ClientSDK" -ComputerName '*computername*'
if(@($CCMUpdate | where { $_.EvaluationState -eq '2' -or $_.EvaluationState -eq '3' -or $_.EvaluationState -eq '4' -or $_.EvaluationState -eq '5' -or $_.EvaluationState -eq '6' -or $_.EvaluationState -eq '7' -or $_.EvaluationState -eq '8' }).length -ne 0) { $result = $true } else { $result = $false }
(If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)
Regards
Andreas Baumgarten