Add-SCPowerOptimizationRange
Adds a time range to the power optimization schedule in a dynamic optimization configuration.
Syntax
Add-SCPowerOptimizationRange
-DynamicOptimizationConfiguration <HostGroupDOSettings>
-EndHour <Int32>
-BeginHour <Int32>
-WeeklyScheduleDayOfWeek <Int32>
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
The Add-SCPowerOptimizationRange cmdlet adds a time range to the power optimization schedule in the dynamic optimization configuration. Power optimization is implemented only during the time ranges that have been added. Otherwise, hosts associated with the dynamic optimization configuration are turned on.
Examples
Example 1: Add a time range for power optmization to a dynamic optimization configuration
PS C:\> $HostGroup = Get-SCVMHostGroup "HostGroup01"
PS C:\> $DOConfig = Get-SCDynamicOptimizationConfiguration -VMHostGroup $HostGroup
PS C:\> Add-SCPowerOptimizationRange -DynamicOptimizationConfiguration $DOConfig -BeginHour 19 -EndHour 23 -WeeklyScheduleDayOfWeek 0
The first command gets the host group object named HostGroup01 and stores the object in the $HostGroup variable.
The second command gets the dynamic optimization configuration object for the host group stored in $HostGroup and stores the object in the $DOConfig variable.
The last command adds a time range to the dynamic optimization configuration stored in $DOConfig.
Parameters
-BeginHour
Specifies the hour of the day that power optimization begins.
Type: | Int32 |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Confirm
Prompts you for confirmation before running the cmdlet.
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DynamicOptimizationConfiguration
Specifies a dynamic optimization configuration object.
Type: | HostGroupDOSettings |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-EndHour
Specifies the hour of the day that power optimization ends.
Type: | Int32 |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-JobVariable
Specifies that job progress is tracked and stored in the variable named by this parameter.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-PROTipID
Specifies the ID of the Performance and Resource Optimization tip (PRO tip) that triggered this action. This parameter lets you audit PRO tips.
Type: | Guid |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-RunAsynchronously
Indicates that the job runs asynchronously so that control returns to the command shell immediately.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-WeeklyScheduleDayOfWeek
Specifies one or more days of the week to run a job. The default value is the current day of the week.
Valid values to specify an individual day by using a string: Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday.
Valid values to specify a set of days in a week: Any set of two or more days separated by commas.
Valid values to specify an individual day by using an integer: 1, 2, 3, 4, 5, 6, 7.
Type: | Int32 |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Outputs
PowerOptimizationSchedule
This cmdlet returns a PowerOptimizationSchedule object.