Author Posts

July 12, 2018 at 4:25 am

Hello
I have a cmdlet for HP servers ILO. output is like this:

IP : 10.0.87.165
HOSTNAME :
STATUS_TYPE : OK
STATUS_MESSAGE : OK
BATTERY_STATUS : OK
BIOS_HARDWARE_STATUS : OK
FANS : {@{STATUS=OK}, @{REDUNDANCY=Redundant}}
MEMORY_STATUS : OK
NETWORK_STATUS : OK
POWER_SUPPLIES : {@{STATUS=OK}, @{REDUNDANCY=Redundant}}
PROCESSOR_STATUS : OK
STORAGE_STATUS : Degraded
TEMPERATURE_STATUS : OK

Now I am trying to eliminate all poperties with ok status, and just show Degraded or anything but ok. for any server objects can be different based on ILO version, Then I can't select specific objects and name them so I used "Select-Object *".
Here is my code. please tell me what is wrong and how can I correct it:

Get-HPiLOHealthSummary -server 10.0.87.165 -Username sth -Password sthelse -DisableCertificateAuthentication|
Select-Object * | ForEach-Object {$property,$value = $_.Split(':')
if($value -ne "OK"){ write-host $property}
}

July 12, 2018 at 1:39 pm

Is that output just a bunch of string, or is it properties with values?