Skip to content

Instantly share code, notes, and snippets.

@gaelcolas
Last active July 29, 2016 14:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gaelcolas/2a4f2f6553bddca3a26164612a6761dc to your computer and use it in GitHub Desktop.
Save gaelcolas/2a4f2f6553bddca3a26164612a6761dc to your computer and use it in GitHub Desktop.
Q&D PowerShell Temperature Gauge for Surface Pro 3
$pshost = get-host
$pswindow = $pshost.ui.rawui
$newsize = $pswindow.windowsize
$newsize.height = 8
$newsize.width = 80
$pswindow.windowsize = $newsize
$pswindow.buffersize = $newsize
cls;while ($true){
$temp = gwmi MSAcpi_ThermalZoneTemperature -Namespace "root/wmi"
$ProgressParams = @{
PercentComplete = (($temp.CurrentTemperature / $temp.CriticalTripPoint)*100)
Activity = "Temperature $($temp.CurrentTemperature)"
Status = (Get-date)
}
Write-Progress @ProgressParams
Start-Sleep 15
}
@gaelcolas
Copy link
Author

Made this shortcut to call the content of the Gist:
(wget 'http://bit.ly/2a4WXEz').content | iex

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment