mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-05-05 16:14:42 +02:00
Update check-smart-devices.ps1
This commit is contained in:
parent
cb53701a0a
commit
cea14316e6
@ -47,9 +47,7 @@ try {
|
|||||||
continue
|
continue
|
||||||
} elseif ($IsLinux) {
|
} elseif ($IsLinux) {
|
||||||
$Details = (sudo smartctl --all --json $Device) | ConvertFrom-Json
|
$Details = (sudo smartctl --all --json $Device) | ConvertFrom-Json
|
||||||
if ($lastExitCode -ne "0") { throw "'sudo smartctl --all --json $Device' exited with error code $lastExitCode" }
|
|
||||||
$null = (sudo smartctl --test=short $Device)
|
$null = (sudo smartctl --test=short $Device)
|
||||||
if ($lastExitCode -ne "0") { throw "'sudo smartctl --test=short $Device' exited with error code $lastExitCode" }
|
|
||||||
} else {
|
} else {
|
||||||
$Details = (smartctl --all --json $Device) | ConvertFrom-Json
|
$Details = (smartctl --all --json $Device) | ConvertFrom-Json
|
||||||
$null = (smartctl --test=short $Device)
|
$null = (smartctl --test=short $Device)
|
||||||
|
Loading…
Reference in New Issue
Block a user