-
Notifications
You must be signed in to change notification settings - Fork 52
Set HPOVServerPower
Set the power state of a server.
Set-HPOVServerPower [-Server] <Object> [-PowerState] <String> [-PowerControl] <String> [-ApplianceConnection] <Object>[ [-WhatIf] <SwitchParameter>][ [-Confirm] <SwitchParameter>] [<CommonParameters>]
[Deprecated] Please note this Cmdlet is being deprecated for in favor of Start-HPOVServer, Stop-HPOVServer and Restart-HPOVServer Cmdlets. Please update your scripts accordingly.
Set the power state of the server using the virtual power button.
-ApplianceConnection <Object>
Aliases [-Appliance]
Specify one HPOneView.Appliance.Connection object or Name property value. If Resource object is provided via Pipeline, the ApplianceConnection property of the object will be used.
Default Value: ${Global:ConnectSessions} | ? Default
[Object]$ApplianceConnection = (${Global:ConnectedSessions} | ? Default)
Aliases | Appliance |
Required? | true |
Position? | named |
Default value | (${Global:ConnectedSessions} | ? Default) |
Accept pipeline input? | true (ByPropertyName) |
Accept wildcard characters? | False |
-Confirm <SwitchParameter>
Aliases | cf |
Required? | false |
Position? | named |
Default value | |
Accept pipeline input? | false |
Accept wildcard characters? | False |
-PowerControl <String>
Optional setting to control the virtual power button. Default is MomentaryPress, other options are PressAndHold, ColdBoot and Reset
Current state powerState powerControl Result
On On MomentaryPress Exception: cannot achieve desired power state via the specified power control On On PressAndHold Exception: cannot achieve desired power state via the specified power control On On ColdBoot OK On On Reset OK On Off MomentaryPress OK (just have to assume that there?s an OS on the server and it will power off the server someday?) On Off PressAndHold OK On Off ColdBoot Exception: cannot achieve desired power state via the specified power control On Off Reset Exception: cannot achieve desired power state via the specified power control Off On MomentaryPress OK Off On PressAndHold Exception: cannot achieve desired power state via the specified power control Off On ColdBoot Exception: cannot achieve desired power state via the specified power control Off On Reset Exception: cannot achieve desired power state via the specified power control Off Off MomentaryPress Exception: cannot achieve desired power state via the specified power control Off Off PressAndHold Exception: cannot achieve desired power state via the specified power control Off Off ColdBoot Exception: cannot achieve desired power state via the specified power control Off Off Reset Exception: cannot achieve desired power state via the specified power control
Aliases | None |
Required? | true |
Position? | 2 |
Default value | MomentaryPress |
Accept pipeline input? | false |
Accept wildcard characters? | False |
-PowerState <String>
Optional power state. Default is On, other option is Off
Aliases | None |
Required? | true |
Position? | 1 |
Default value | On |
Accept pipeline input? | false |
Accept wildcard characters? | False |
-Server <Object>
Aliases [-name, -uri, -serverUri] The server object, URI or Name, or can be a Server Profile object.
Aliases | name, uri, serverUri |
Required? | true |
Position? | 0 |
Default value | |
Accept pipeline input? | true (ByValue) |
Accept wildcard characters? | False |
-WhatIf <SwitchParameter>
Aliases | wi |
Required? | false |
Position? | named |
Default value | |
Accept pipeline input? | false |
Accept wildcard characters? | False |
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer, PipelineVariable, and OutVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216)
System.String Server Hardware Name
System.Management.Automation.PSCustomObject Server Hardware Resource
System.Management.Automation.PSCustomObject Server Profile Resource
HPOneView.Appliance.TaskResource [System.Management.Automation.PSCustomObject] Async task that tracks the power state change
-------------------------- EXAMPLE 1 --------------------------PS C:\> Get-HPOVServer "Encl1, Bay 1" | Set-HPOVServerPower | Wait-HPOVTaskComplete
Power on the specific server device by passing the Server Object via pipeline to Set-HPOVServerPower.
-------------------------- EXAMPLE 2 --------------------------PS C:\> Get-HPOVServer "Encl1, Bay 1" | Set-HPOVServerPower -powerState off -powerControl PressAndHold
Power off the specific server device by passing the Server Object via pipeline to Set-HPOVServerPower.
-------------------------- EXAMPLE 3 --------------------------PS C:\> $task = Get-HPOVServerProfile "Profile1" -ApplianceConnection "MyAppliance.domain.com" | Set-HPOVServerPower -powerState On -powerControl MomentaryPress
Power on the specific server hardware by using the Server Profile object.
- [Get-HPOVServer] (https://github.com/HewlettPackard/POSH-HPOneView/wiki/Get-HPOVServer)
- [Get-HPOVServerProfile] (https://github.com/HewlettPackard/POSH-HPOneView/wiki/Get-HPOVServerProfile)
Set the power state of a server.
Set-HPOVServerPower [-server] <server>[ [-powerState] <powerState>][ [-powerControl] <powerControl>] [<CommonParameters>]
Set the power state of the server using the virtual power button.
-server <server>
Aliases [-name, -uri, -serverUri] The server object, URI or Name, or can be a Server Profile object.
Aliases | None. |
Required? | true |
Position? | 1 |
Default value | |
Accept pipeline input? | true (ByValue) |
Accept wildcard characters? | false |
-powerState <powerState>
Optional power state. Default is On, other option is Off
Aliases | None. |
Required? | false |
Position? | 2 |
Default value | On |
Accept pipeline input? | false |
Accept wildcard characters? | false |
-powerControl <powerControl>
Optional setting to control the virtual power button. Default is MomentaryPress, other options are PressAndHold, ColdBoot and Reset
Current state powerState powerControl Result
On On MomentaryPress Exception: cannot achieve desired power state via the specified power control On On PressAndHold Exception: cannot achieve desired power state via the specified power control On On ColdBoot OK On On Reset OK On Off MomentaryPress OK (just have to assume that there�s an OS on the server and it will power off the server someday�) On Off PressAndHold OK On Off ColdBoot Exception: cannot achieve desired power state via the specified power control On Off Reset Exception: cannot achieve desired power state via the specified power control Off On MomentaryPress OK Off On PressAndHold Exception: cannot achieve desired power state via the specified power control Off On ColdBoot Exception: cannot achieve desired power state via the specified power control Off On Reset Exception: cannot achieve desired power state via the specified power control Off Off MomentaryPress Exception: cannot achieve desired power state via the specified power control Off Off PressAndHold Exception: cannot achieve desired power state via the specified power control Off Off ColdBoot Exception: cannot achieve desired power state via the specified power control Off Off Reset Exception: cannot achieve desired power state via the specified power control
Aliases | None. |
Required? | false |
Position? | 3 |
Default value | MomentaryPress |
Accept pipeline input? | false |
Accept wildcard characters? | false |
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer, PipelineVariable, and OutVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216)
System.String Server Hardware Name System.Management.Automation.PSCustomObject Server Hardware Resource
HPOneView.Appliance.TaskResource [System.Management.Automation.PSCustomObject] Async task that tracks the power state change
-------------------------- EXAMPLE 1 --------------------------PS C:\> Get-HPOVServer "Encl1, Bay 1" | Set-HPOVServerPower
Power on the specific server device by passing the Server Object via pipeline to Set-HPOVServerPower.
-------------------------- EXAMPLE 2 --------------------------PS C:\> Get-HPOVServer "Encl1, Bay 1" | Set-HPOVServerPower -powerState off -powerControl PressAndHold
Power off the specific server device by passing the Server Object via pipeline to Set-HPOVServerPower.
-------------------------- EXAMPLE 3 --------------------------PS C:\> $pro = Get-HPOVProfile "Profile1" PS C:\> Set-HPOVServerPower -serverUri $pro.configuration.assignedToServerUri -powerState On -powerControl MomentaryPress
Power on the specific server hardware by using the Server Profiles assignedToServerUri property.
- [Get-HPOVServer] (https://github.com/HewlettPackard/POSH-HPOneView/wiki/Get-HPOVServer)
- [Get-HPOVProfile] (https://github.com/HewlettPackard/POSH-HPOneView/wiki/Get-HPOVProfile)