From 650e9b5d857ce60b14cc2d551e9ab737a90ee064 Mon Sep 17 00:00:00 2001 From: Markus Fleschutz Date: Mon, 17 Oct 2022 09:15:12 +0200 Subject: [PATCH] Update check-smart-devices.ps1 --- Scripts/check-smart-devices.ps1 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Scripts/check-smart-devices.ps1 b/Scripts/check-smart-devices.ps1 index a8487f2a..ce819296 100755 --- a/Scripts/check-smart-devices.ps1 +++ b/Scripts/check-smart-devices.ps1 @@ -27,7 +27,9 @@ try { Write-Progress "⏳ Step 3/3 - Querying S.M.A.R.T devices..." $Array = $Device.split(" ") $Device = $Array[0] - if ($IsLinux) { + if ("$Device" -eq "#") { + continue + } elseif ($IsLinux) { $Details = (sudo smartctl --all --json $Device) | ConvertFrom-Json } else { $Details = (smartctl --all --json $Device) | ConvertFrom-Json @@ -39,7 +41,7 @@ try { $PowerOn = $Details.power_cycle_count $Hours = $Details.power_on_time.hours if ($Details.smart_status.passed) { $Status = "passed" } else { $Status = "NOT PASSED" } - "✅ Device $ModelName (SMART $Type), $($Capacity)GB, $($PowerOn)x on, $($Hours)h, $($Temp)°C, $Status" + "✅ SMART device $ModelName ($Type), $($Capacity)GB, $($PowerOn)x on, $($Hours) hours, $($Temp)°C, $Status" } exit 0 # success } catch {