HPE OneView
cancel
Showing results for 
Search instead for 
Did you mean: 

PowerShell help

Matthew Ingram
Regular Advisor

PowerShell help

How do you access the properites of the server profile that have spaces in them? For example I am trying to get a list of all servers profiles that have a certain hardware type. I can't seem to filter based on the properites that have a space.

get-hpovserverprofile | ? {$_."server hardware type" -eq "BL460c Gen8 3"}

This returns nothing. I can't even select object on "server hardware type" in the get-hpovserverprofile cmdlet.

What am I missing?

7 REPLIES
ChrisLynchHPE
Neighborhood Moderator

Re: PowerShell help

For future questions with the library, feel free to open an issue on the GitHub Issues Tracker (yes, even for questions like this).

That being said, the "Server Hardware Type" is a format column header, not an actual property.  Objects from the HPE OneView API are what's called "Deflated Objects".  Meaning, associative resources are via their URI.  So, if you are trying to filter Server Hardware for a specific Hardware Type, please use the "-InputObject" parameter found in the current 3.00 library.  This will take a Server Hardware Type or Server Profile object to filter the list of server hardware to what you are looking to do.

Matthew Ingram
Regular Advisor

Re: PowerShell help

 Hi Chris,

Can you provide a link to the documentation or an example of this? I don't see an "inputobject" parameter on either get-hpovserverprofile or get-hpovserverhardwaretype on the githib cmdlet documentation.

 

Thanks

 

 

ChrisLynchHPE
Neighborhood Moderator

Re: PowerShell help

The -InputObject parameter exists in the Get-HPOVServer Cmdlet.  You would pass in a SHT or Server Profile object to return a filtered list of Server Hardware resources.

Do you need a way to filter Profiles based on Hardware Type?  I could look at extending the Get-HPOVServerProfile Cmdlet to allow Server Hardware Type objects to then filter the results.  If that is what you are looking for, please submit an issue on the GitHub Issue Tracker for this request.

Matthew Ingram
Regular Advisor

Re: PowerShell help

Hi Chris,

Here is the goal. This might make what I am trying to do a little easier to understand. I need to indetify all server profiles assigned to blade servers with specifc LOM adapater. My though was to use the get-hpovserverprofile and pipe that into where server hardware type =x. As another example of where I would like to see these defalted objects is to have a powershell script return a list of all server profiles with their virtual serial number and include the phsyical serial number of the server hardare itself. Does that make sense?

 

Thanks,

Matt

ChrisLynchHPE
Neighborhood Moderator

Re: PowerShell help

PLease go submit an issue on the tracker so we can continue the conversation there.  It will also help me track enhancements, and provide others with a singular location to find conversations/threads like this for the library.

Matthew Ingram
Regular Advisor

Re: PowerShell help

Will do.

 

Thanks