S
sba923
On one of my computers POWERCFG /ENERGY doesn't function (anymore).
It returns immediately and doesn't create the expected output file.
I have created a PowerShell test script that helps reproducing the issue.
Here's the script:
#requires -RunAsAdministrator
$starttime = (Get-Date)
$outputfile = Join-Path -Path $env:TEMP -ChildPath "pcet.html"
& powercfg /energy /duration 30 /output $outputfile
$rc = $LASTEXITCODE
Write-Host("POWERCFG /ENERGY returned with exit code {0} in {1} seconds" -f $rc, ((Get-Date) - $starttime).TotalSeconds)
if (Test-Path -LiteralPath $outputfile)
{
Write-Host -ForegroundColor Green ("Output file '{0}' WAS created" -f $outputfile)
Remove-Item -Force -LiteralPath $outputfile
}
else
{
Write-Host -ForegroundColor Red ("Output file '{0}' was NOT created" -f $outputfile)
}
Here's the output on a computer without the issue:
and here's the output on the offending computer:
Both computers are running Windows 10 build 17763.503 (latest RS5/1809 build).
Where do I go from here?
Continue reading...
It returns immediately and doesn't create the expected output file.
I have created a PowerShell test script that helps reproducing the issue.
Here's the script:
#requires -RunAsAdministrator
$starttime = (Get-Date)
$outputfile = Join-Path -Path $env:TEMP -ChildPath "pcet.html"
& powercfg /energy /duration 30 /output $outputfile
$rc = $LASTEXITCODE
Write-Host("POWERCFG /ENERGY returned with exit code {0} in {1} seconds" -f $rc, ((Get-Date) - $starttime).TotalSeconds)
if (Test-Path -LiteralPath $outputfile)
{
Write-Host -ForegroundColor Green ("Output file '{0}' WAS created" -f $outputfile)
Remove-Item -Force -LiteralPath $outputfile
}
else
{
Write-Host -ForegroundColor Red ("Output file '{0}' was NOT created" -f $outputfile)
}
Here's the output on a computer without the issue:
and here's the output on the offending computer:
Both computers are running Windows 10 build 17763.503 (latest RS5/1809 build).
Where do I go from here?
Continue reading...