Improve usage of test-path

This commit is contained in:
Markus Fleschutz
2021-06-07 08:48:17 +02:00
parent a39508856b
commit 7a57971d0c
4 changed files with 11 additions and 11 deletions

View File

@ -6,7 +6,7 @@
#>
try {
if (test-path "/sys/class/thermal/thermal_zone0/temp") {
if (test-path "/sys/class/thermal/thermal_zone0/temp" -pathType leaf) {
[int]$IntTemp = get-content "/sys/class/thermal/thermal_zone0/temp"
$Temp = [math]::round($IntTemp / 1000.0, 1)
} else {