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

PowerShell OneView commandline clarification

 
ArubaGuy
Occasional Advisor

PowerShell OneView commandline clarification

Hey all, thanks for any help, I'm struggling to get this command to work:

get-hpovserver -name "[server name]" | stop-hpovserver

I need it to stop the server without the prompt to confirm (Yes, Yes to All, No, No to All, etc.). I have to write a script to do many of these servers in one shot. So far my Google-fu has failed me. Any tips?

Thanks!
Mike

1 REPLY 1
ArubaGuy
Occasional Advisor

Re: PowerShell OneView commandline clarification

Nevermind, figured it out. The command should be:

get-hpovserver -name "ILOMXQ834006Y" | stop-hpovserver -confirm:$false

I wish the documentation was clearer about the possible parameters for all of these scripts. If I look at the commandline specified in the Github page, it reads: 

Stop-HPOVServer [-InputObject] <Object>[ [-Async] <SwitchParameter>] [-ApplianceConnection] <Object>[ [-WhatIf] <SwitchParameter>][ [-Confirm] <SwitchParameter>] [<CommonParameters>]

 To me, that implies that after the "-Confirm", there should be a space, then some sort of parameter, similar to this:

stop-hpovserver -confirm false

I haven't found anywhere that has a general guide for how to use these parameters, such as "don't put a space, put a colon" and "possible values are: $true, $false", etc.

I've spent so much time banging my head on the unclear documentation for these PowerShell utilities, trying to randomly guess the right parameters... am I just missing something that gives you general usage info (not command-specific info)?

Thanks,

Mike