Expanding multiple NoteProperties??

Hello,

Try this:

Get-HPiLOHealthSummary -server xxxxx -username xxx-password xxx | select @{name="FANS Status";expression={$_.FANS.STATUS}},@{name="POWER_SUPPLIES Status";expression={$_.POWER_SUPPLIES.STATUS}}

If it doesn't work then run these commands and post output:

Get-HPiLOHealthSummary -server xxxxx -username xxx-password xxx| get-member

Get-HPiLOHealthSummary -server xxxxx -username xxx-password xxx| select -expand FANS |get-member

Get-HPiLOHealthSummary -server xxxxx -username xxx-password xxx| select -expand power_supplies |get-member
Good luck)

January 20th, 2014 6:42am

Ok, you first suggestion returns this output

FANS Status                                                                                     POWER_SUPPLIES Stat
-----------                                                                                     -------------------
{OK, $null}                                                                                     {FAILED, $null}

Here's the output for the other commands (in order)

PS C:\> Get-HPiLOHealthSummary -server $target -username $UserName -password $password | gm


   TypeName: System.Management.Automation.PSCustomObject

Name               MemberType   Definition
----               ----------   ----------
Equals             Method       bool Equals(System.Object obj)
GetHashCode        Method       int GetHashCode()
GetType            Method       type GetType()
ToString           Method       string ToString()
DRIVE_STATUS       NoteProperty System.String DRIVE_STATUS=Ok
FANS               NoteProperty System.Object[] FANS=System.Object[]
HOSTNAME           NoteProperty System.String HOSTNAME=belbru-trmv003
IP                 NoteProperty System.String IP=172.18.121.29
POWER_SUPPLIES     NoteProperty System.Object[] POWER_SUPPLIES=System.Object[]
STATUS_MESSAGE     NoteProperty System.String STATUS_MESSAGE=OK
STATUS_TYPE        NoteProperty System.String STATUS_TYPE=OK
TEMPERATURE_STATUS NoteProperty System.String TEMPERATURE_STATUS=OK


PS C:\> Get-HPiLOHealthSummary -server $target -username $UserName -password $password |select -expand FANS| gm


   TypeName: Selected.System.Management.Automation.PSCustomObject

Name        MemberType   Definition
----        ----------   ----------
Equals      Method       bool Equals(System.Object obj)
GetHashCode Method       int GetHashCode()
GetType     Method       type GetType()
ToString    Method       string ToString()
STATUS      NoteProperty System.String STATUS=OK


PS C:\> Get-HPiLOHealthSummary -server $target -username $UserName -password $password |select -expand power_supplies| gm


   TypeName: Selected.System.Management.Automation.PSCustomObject

Name        MemberType   Definition
----        ----------   ----------
Equals      Method       bool Equals(System.Object obj)
GetHashCode Method       int GetHashCode()
GetType     Method       type GetType()
ToString    Method       string ToString()
STATUS      NoteProperty System.String STATUS=FAILED
Free Windows Admin Tool Kit Click here and download it now
January 20th, 2014 8:24am

I really should be able to figure this out!  I'm playing with the HPILO Cmdlets.  One of them, Get-HPILOHealthSummary, has multiple expandable properties

So, this is basic output of  Get-HPiLOHealthSummary -server xxxxx -username xxx-password xxx|select *

STATUS_TYPE        : OK
STATUS_MESSAGE     : OK
DRIVE_STATUS       : Ok
FANS               : {@{STATUS=OK}, @{REDUNDANCY=REDUNDANT}}
POWER_SUPPLIES     : {@{STATUS=FAILED}, @{REDUNDANCY=NOT REDUNDANT}}
TEMPERATURE_STATUS : OK

However, I just want to return the STATUS field from FANS and POWER_SUPPLIES.

This is output from Get-HPiLOHealthSummary -server xxxxx -username xxx-password xxx|select * -expand Power_supplies

STATUS             : FAILED

STATUS_TYPE        : OK
STATUS_MESSAGE     : OK
DRIVE_STATUS       : Ok
FANS               : {@{STATUS=OK}, @{REDUNDANCY=REDUNDANT}}
POWER_SUPPLIES     : {@{STATUS=FAILED; IP=xxx; HOSTNAME=xx; STATUS_TYPE=OK; STATUS_MESSAGE=OK; DRIVE_STATUS=Ok; FANS=System.Object[]; POWER_SUPPLIES=System.Object[];
                     TEMPERATURE_STATUS=OK}, @{REDUNDANCY=NOT REDUNDANT}}
TEMPERATURE_STATUS : OK

REDUNDANCY         : NOT REDUNDANT

STATUS_TYPE        : OK
STATUS_MESSAGE     : OK
DRIVE_STATUS       : Ok
FANS               : {@{STATUS=OK}, @{REDUNDANCY=REDUNDANT}}
POWER_SUPPLIES     : {@{STATUS=FAILED; IP=xxx; HOSTNAME=xxx; STATUS_TYPE=OK; STATUS_MESSAGE=OK; DRIVE_STATUS=Ok; FANS=System.Object[]; POWER_SUPPLIES=System.Object[];
                     TEMPERATURE_STATUS=OK}, @{REDUNDANCY=NOT REDUNDANT; IP=xxx; HOSTNAME=xxx; STATUS_TYPE=OK; STATUS_MESSAGE=OK; DRIVE_STATUS=Ok; FANS=System.Object[];
                     POWER_SUPPLIES=System.Object[]; TEMPERATURE_STATUS=OK}}
TEMPERATURE_STATUS : OK

How do I select only the STATUS field from the expandable properties?  I assume the confusion is arising because there are two power supplies



  • Edited by Ginolard99 Monday, January 20, 2014 10:19 AM
January 20th, 2014 1:17pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics