在PowerShell 5.1版本中,要获得CPU温度,可以通过以下步骤:
$Computer = "localhost"
$Namespace = "root\cimv2"
$ClassName = "Win32_PerfFormattedData_Counters_ThermalZoneInformation"
$WmiObject = Get-WmiObject -ComputerName $Computer -Namespace $Namespace -Class $ClassName
$Temperature = $WmiObject.Temperature
Write-Host "CPU温度: $Temperature °C"
需要注意的是,以上步骤是基于PowerShell 5.1版本的,不同版本的PowerShell可能会有所差异。此外,获取CPU温度的可用性也取决于硬件和驱动程序的支持情况。
推荐的腾讯云相关产品:腾讯云服务器(CVM) 腾讯云产品介绍链接地址:https://cloud.tencent.com/product/cvm
没有搜到相关的文章