Hi all,
I currently have the following IF statement in my script and I would like to fail the script if the IF statement is TRUE and show the PSADT failed pop ups come up.
if($presence -eq 'True'){
"$date - SfB still exists - $filename" | Out-File -FilePath C:\Windows\Logs\SfB_Still_Exists.log -Append
}else {
"$date - SfB has been uninstalled successfully" | Out-File -FilePath C:\Windows\Logs\SfB_Uninstalled.log -Append
}
If I add Exit 1 (or any other number) to any of the branch, it completely exits the whole PSADT script and I don’t get any pop ups.
Any ideas how I can achieve that?
Basically, if the statement is false (or true, doesnt really matter), bring up the failed pops of PSADT.
Thanks in advance,