Need help in sorting out a data from my output, I want to show only a output saying ALL OK when STATE is RUNNING, and NOT OK if the STATE is Faulted (or any other string).
How can I achieve this?
Invoke-Command -ComputerName XXXXX,XXXX -ScriptBlock { hastatus -sum; VXPRINT -VPl } -credential XXXXX
Output:
-- SYSTEM STATE
-- System State Frozen
A XXXXXXXXXXXXX RUNNING 0
A XXXXXXXXXXXXX RUNNING 0
Invoke-Commandthat refers to a remote system. there is usually a runspace ID and a PSComputerName in the properties returned. are you sure that is ALL the data returned by the call?hastatus -summaryisn't a native powershell command so you'll need to deal the (table-like) string output it returns: stackoverflow.com/questions/38036175/…