This code brings average CPU temps via powershell script but can't find callouts to SSD or HDD temps how can i find callout documentations?
cls
$dll = "LibreHardwareMonitorLib.dll"
Unblock-File -LiteralPath $dll
Add-Type -LiteralPath $dll
$monitor = [LibreHardwareMonitor.Hardware.Computer]::new()
$monitor.IsCPUEnabled = $true
$monitor.Open()
[int]$temp = foreach ($sensor in $monitor.Hardware.Sensors) {
if ($sensor.SensorType -eq 'Temperature' -and $sensor.Name -eq 'Core Average'){
$sensor.Value
break
}
}
$monitor.Close()
write-host "$temp"
reason im using Libre cos its only option to make scripts via cli, if u know other hardware monitor api's that can work with powershell i would appriciate it
As seen in the LibreHardwareMonitor GitHub documentation, you are missing the Storage initiators.
Not familiar with your code but should look similar to this:
Make sure to optimize the code, I have just added another loop for the SSD but just reworking the first one would be better. Also, SensorType and Name for the SSD may be different, I just used those because that is what i see in my Python app using LibreHardwareMonitor.dll.