-
Notifications
You must be signed in to change notification settings - Fork 52
Set HPOVServerPower
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.
-server <Object>
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 | <none> |
Accept pipeline input? | true (ByValue) |
Accept wildcard characters? | false |
-powerState [<String>]
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 [<String>]
Optional setting to control the virtual power button. Default is MomentaryPress, other options are PressAndHold, ColdBoot and Reset
Current state powerState powerControl Result
OnOn MomentaryPress Exception: cannot achieve desired power state via the specified power control OnOn PressAndHold Exception: cannot achieve desired power state via the specified power control OnOn ColdBoot OK OnOn Reset OK OnOffMomentaryPress OK (just have to assume that there?s an OS on the server and it will power off the server someday?) OnOffPressAndHold OK OnOffColdBoot Exception: cannot achieve desired power state via the specified power control OnOffReset 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 OffMomentaryPress Exception: cannot achieve desired power state via the specified power control Off OffPressAndHold Exception: cannot achieve desired power state via the specified power control Off OffColdBoot Exception: cannot achieve desired power state via the specified power control Off OffReset 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 |
-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 | None |
Required? | true |
Position? | named |
Default value | (${Global:ConnectedSessions} | ? Default) |
Accept pipeline input? | true (ByPropertyName) |
Accept wildcard characters? | false |
-WhatIf [<SwitchParameter>]
Aliases | None |
Required? | false |
Position? | named |
Default value | <none> |
Accept pipeline input? | false |
Accept wildcard characters? | false |
-Confirm [<SwitchParameter>]
Aliases | None |
Required? | false |
Position? | named |
Default value | <none> |
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
#### RELATED LINKS
- [Get-HPOVServer] (https://github.com/HewlettPackard/POSH-HPOneView/wiki/Get-HPOVServer)
- [Get-HPOVServerProfile] (https://github.com/HewlettPackard/POSH-HPOneView/wiki/Get-HPOVServerProfile)
-------------------------- 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.
Set-HPOVServerPower
Set the power state of a server.
Set-HPOVServerPower [-server] <Object> [[-powerState] <String>] [[-powerControl] <String>] [<CommonParameters>]
Set the power state of the server using the virtual power button.
-server <Object>
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 | <none> |
Accept pipeline input? | true (ByValue) |
Accept wildcard characters? | false |
-powerState [<String>]
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 [<String>]
Optional setting to control the virtual power button. Default is MomentaryPress, other options are PressAndHold, ColdBoot and Reset
Current state powerState powerControl Result
OnOn MomentaryPress Exception: cannot achieve desired power state via the specified power control OnOn PressAndHold Exception: cannot achieve desired power state via the specified power control OnOn ColdBoot OK OnOn Reset OK OnOffMomentaryPress OK (just have to assume that there�s an OS on the server and it will power off the server someday�) OnOffPressAndHold OK OnOffColdBoot Exception: cannot achieve desired power state via the specified power control OnOffReset 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 OffMomentaryPress Exception: cannot achieve desired power state via the specified power control Off OffPressAndHold Exception: cannot achieve desired power state via the specified power control Off OffColdBoot Exception: cannot achieve desired power state via the specified power control Off OffReset 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
#### RELATED LINKS
- [Get-HPOVServer] (https://github.com/HewlettPackard/POSH-HPOneView/wiki/Get-HPOVServer)
- [Get-HPOVProfile] (https://github.com/HewlettPackard/POSH-HPOneView/wiki/Get-HPOVProfile)
-------------------------- 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.
Set-HPOVServerPower
Set the power state of a server.
Set-HPOVServerPower [-server] <Object> [[-powerState] <String>] [[-powerControl] <String>] [<CommonParameters>]
Set the power state of the server using the virtual power button.
-server <Object>
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 | <none> |
Accept pipeline input? | true (ByValue) |
Accept wildcard characters? | false |
-powerState [<String>]
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 [<String>]
Optional setting to control the virtual power button. Default is MomentaryPress, other options are PressAndHold, ColdBoot and Reset
Current state powerState powerControl Result
OnOn MomentaryPress Exception: cannot achieve desired power state via the specified power control OnOn PressAndHold Exception: cannot achieve desired power state via the specified power control OnOn ColdBoot OK OnOn Reset OK OnOffMomentaryPress OK (just have to assume that there�s an OS on the server and it will power off the server someday�) OnOffPressAndHold OK OnOffColdBoot Exception: cannot achieve desired power state via the specified power control OnOffReset 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 OffMomentaryPress Exception: cannot achieve desired power state via the specified power control Off OffPressAndHold Exception: cannot achieve desired power state via the specified power control Off OffColdBoot Exception: cannot achieve desired power state via the specified power control Off OffReset 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
System.Management.Automation.PSCustomObject
Async task that tracks the power state change
#### RELATED LINKS
- [Get-HPOVServer] (https://github.com/HewlettPackard/POSH-HPOneView/wiki/Get-HPOVServer)
- [Get-HPOVProfile] (https://github.com/HewlettPackard/POSH-HPOneView/wiki/Get-HPOVProfile)
-------------------------- 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.