< Back

Set-PowerPlanActionedSetting

Sat Jan 18, 2020 9:30 pm

NAME Set-PowerPlanActionedSetting



SYNOPSIS

Set the value of a specific power setting with a particular action.





SYNTAX

Set-PowerPlanActionedSetting [-PowerSettingAction] <String> [[-SettingObject] <Object>] [<CommonParameters>]





DESCRIPTION

Set actioned settings, those with options like Do Nothing, Sleep, Hibernate, and Shut down, to the desired setting

level. Required

parameters include the PowerSettingAction and SettingObject are required in order to set these settings.





PARAMETERS

-PowerSettingAction <String>

Specify the specific action you'd like the power setting to take. The only values accepted are "DoNothing",

"Sleep", "Hibernate", and "ShutDown" which can all be tab completed. This parameter is required.



Required? true

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



-SettingObject <Object>

Pass the setting object directly to the script. To retrieve this option Get-PowerPlanSettingValue function.



Required? false

Position? 2

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 (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



NOTES





NAME : Set-PowerPlanActionedSetting

AUTHOR : BMO

EMAIL : brandonseahorse@gmail.com

GITHUB : github.com/Bmo1992

CREATED : September 17, 2019

META : There might be a smarter way to do this but I'm not a smart man.



-------------------------- EXAMPLE 1 --------------------------



PS C:\\>Set-PowerPlanActionedSetting -SettingObject $(Get-PowerPlanSettingValue -InputPowerPlanId $(Get-PowerPlanId

-Active:$True) `



-InputPowerPlanSettingId $(Get-PowerPlanSettingId -Name "Low battery action")) -PowerSettingAction DoNothing



This will set the Low battery action setting of the currently active power plan to the action "DoNothing"











RELATED LINKS