Skip to content

Instantly share code, notes, and snippets.

@erickximenes
Created May 16, 2022 11:26
Show Gist options
  • Save erickximenes/54ad032d91546cb5f1b946fd197eb81e to your computer and use it in GitHub Desktop.
Save erickximenes/54ad032d91546cb5f1b946fd197eb81e to your computer and use it in GitHub Desktop.
$timer = new-timespan -Minutes 1
$clock = [diagnostics.stopwatch]::StartNew()
while ($clock.elapsed -lt $timer){
$command=Get-WmiObject MSAcpi_ThermalZoneTemperature -Namespace "root/wmi" | Ft @{Expression={$_.InstanceName};Label="CORE#"},@{Expression={($_.CurrentTemperature / 10) - 273.15};Label="CELSIUS"},@{Expression={((9/5) * (($_.CurrentTemperature / 10) - 273.15) + 32)};Label="FAHRENHEIT"} >> temperatura.txt
cls
$command
start-sleep -seconds 5
}
write-host "fim da analise de temperatura (^_^)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment