Hi @Bruce Taylor ,
maybe this helps to get started:
add $LASTEXITCODE
at the end of check_cluster_node.ps1
than modify the last line of the script you posted above:
$result = Invoke-Command -ComputerName $IPaddress -Authentication Negotiate -Credential $creds -FilePath \tmp\check_cluster_node.ps1 -ArgumentList $Clustername
$result
The variable $result
should contain the output of $LASTEXITCODE
.
----------
(If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)
Regards
Andreas Baumgarten