You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Like other projects, it looks like the only option is to use the Windows APIs via powercfg.exe command.
Host used
powershell.exe
ISE
VS Code
Other (please specify)
If anything other than powershell.exe was used, please confirm that you can duplicate the issue with powershell.exe
Still buggy in powershell.exe
Errors Received
writeErrorStream : True
PSMessageDetails :
Exception : System.Exception: Couldn't set the requested Power Plan 'High Performance' on sqlserver.
TargetObject : sqlserver
CategoryInfo : ConnectionError: (sqlserver:PSObject) [Write-Error], Exception
FullyQualifiedErrorId : dbatools_Set-DbaPowerPlanInternal,Stop-Function
ErrorDetails : Couldn't set the requested Power Plan 'High Performance' on sqlserver.
InvocationInfo : System.Management.Automation.InvocationInfo
ScriptStackTrace : at Stop-Function, C:\Users\username\Documents\WindowsPowerShell\Modules\dbatools\1.0.107\allcommands.ps1: line 82910
at Set-DbaPowerPlanInternal, C:\Users\username\Documents\WindowsPowerShell\Modules\dbatools\1.0.107\allcommands.ps1: line 65811
at Set-DbaPowerPlan<Process>, C:\Users\username\Documents\WindowsPowerShell\Modules\dbatools\1.0.107\allcommands.ps1: line 65849
at <ScriptBlock>, <No file>: line 1
PipelineIterationInfo : {0, 1}
Steps to Reproduce
Run the Set-DbaPowerPlan command on a fresh deployment of Windows Server 2019
Set-DbaPowerPlan-ComputerName sqlserver
Expected Behavior
Windows Power Plan to be set to 'High Performance'
Actual Behavior
Error thrown and Power Plan failed to update.
The text was updated successfully, but these errors were encountered:
Environmental information
Report
On Windows Server 2019, the Set-DbaPowerPlan command fails as it appears the 'Activate' Cim Method for Win32_PowerPlan appears to be broken.
This seems to be widely reported in other community projects:
Like other projects, it looks like the only option is to use the Windows APIs via
powercfg.exe
command.Host used
If anything other than powershell.exe was used, please confirm that you can duplicate the issue with powershell.exe
Errors Received
Steps to Reproduce
Run the Set-DbaPowerPlan command on a fresh deployment of Windows Server 2019
Expected Behavior
Windows Power Plan to be set to 'High Performance'
Actual Behavior
Error thrown and Power Plan failed to update.
The text was updated successfully, but these errors were encountered: