1

I want to develop a Powershell script to get CPU temperature. Currently I'm using MSAcpi_ThermalZoneTemperature class using Get-WMIObject:

Get-WmiObject -Class MSAcpi_ThermalZoneTemperature -Namespace "root/wmi"

As a result of above command I'm getting 3 objects, only 1 of which is for the CPU:

__GENUS              : 2
__CLASS              : MSAcpi_ThermalZoneTemperature
__SUPERCLASS         : MSAcpi
__DYNASTY            : MSAcpi
__RELPATH            : MSAcpi_ThermalZoneTemperature.InstanceName="ACPI\\ThermalZone\\TZ00_0"
__PROPERTY_COUNT     : 12
__DERIVATION         : {MSAcpi}
__SERVER             : LAPTOP-T4Q10Q07
__NAMESPACE          : root\wmi
__PATH               : \\LAPTOP-T4Q10Q07\root\wmi:MSAcpi_ThermalZoneTemperature.InstanceName="ACPI\\ThermalZone\\TZ00_0"
Active               : True
ActiveTripPoint      : {3782, 3282, 3232, 0...}
ActiveTripPointCount : 3
CriticalTripPoint    : 4832
CurrentTemperature   : 0
InstanceName         : ACPI\ThermalZone\TZ00_0
PassiveTripPoint     : 0
Reserved             : 0
SamplingPeriod       : 0
ThermalConstant1     : 0
ThermalConstant2     : 0
ThermalStamp         : 101
PSComputerName       : LAPTOP-T4Q10Q07

__GENUS              : 2
__CLASS              : MSAcpi_ThermalZoneTemperature
__SUPERCLASS         : MSAcpi
__DYNASTY            : MSAcpi
__RELPATH            : MSAcpi_ThermalZoneTemperature.InstanceName="ACPI\\ThermalZone\\TZ01_0"
__PROPERTY_COUNT     : 12
__DERIVATION         : {MSAcpi}
__SERVER             : LAPTOP-T4Q10Q07
__NAMESPACE          : root\wmi
__PATH               : \\LAPTOP-T4Q10Q07\root\wmi:MSAcpi_ThermalZoneTemperature.InstanceName="ACPI\\ThermalZone\\TZ01_0"
Active               : True
ActiveTripPoint      : {0, 0, 0, 0...}
ActiveTripPointCount : 0
CriticalTripPoint    : 4832
CurrentTemperature   : 0
InstanceName         : ACPI\ThermalZone\TZ01_0
PassiveTripPoint     : 0
Reserved             : 0
SamplingPeriod       : 0
ThermalConstant1     : 0
ThermalConstant2     : 0
ThermalStamp         : 101
PSComputerName       : LAPTOP-T4Q10Q07

__GENUS              : 2
__CLASS              : MSAcpi_ThermalZoneTemperature
__SUPERCLASS         : MSAcpi
__DYNASTY            : MSAcpi
__RELPATH            : MSAcpi_ThermalZoneTemperature.InstanceName="ACPI\\ThermalZone\\TZ02_0"
__PROPERTY_COUNT     : 12
__DERIVATION         : {MSAcpi}
__SERVER             : LAPTOP-T4Q10Q07
__NAMESPACE          : root\wmi
__PATH               : \\LAPTOP-T4Q10Q07\root\wmi:MSAcpi_ThermalZoneTemperature.InstanceName="ACPI\\ThermalZone\\TZ02_0"
Active               : True
ActiveTripPoint      : {0, 0, 0, 0...}
ActiveTripPointCount : 0
CriticalTripPoint    : 0
CurrentTemperature   : 3010
InstanceName         : ACPI\ThermalZone\TZ02_0
PassiveTripPoint     : 0
Reserved             : 0
SamplingPeriod       : 0
ThermalConstant1     : 0
ThermalConstant2     : 0
ThermalStamp         : 100
PSComputerName       : LAPTOP-T4Q10Q07

Please suggest me how can I make script to return only object of cpu.

Mathias R. Jessen
  • 157,619
  • 12
  • 148
  • 206
Nirav sachora
  • 113
  • 1
  • 5
  • 12
  • 1
    You have other post, maybe any answer could works: https://stackoverflow.com/questions/39738494/get-cpu-temperature-in-cmd-power-shell – MR Mark II Sep 24 '20 at 11:24
  • 1
    That would only provide the temperature for a zone, _(of your case)_, when a thermal event occurred, not the current temperature of the zone, and certainly not your CPU temperture, _(which, I think for your specific CPU, has a max of around 100°C)_. – Compo Sep 24 '20 at 12:14
  • Does this answer your question? [Get CPU temperature in CMD/POWER Shell](https://stackoverflow.com/questions/39738494/get-cpu-temperature-in-cmd-power-shell) – jkmartindale Sep 06 '22 at 21:17

0 Answers0