mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-12-16 03:30:39 +01:00
Update check-smart-devices.ps1
This commit is contained in:
parent
cb53701a0a
commit
cea14316e6
@ -47,9 +47,7 @@ try {
|
||||
continue
|
||||
} elseif ($IsLinux) {
|
||||
$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)
|
||||
if ($lastExitCode -ne "0") { throw "'sudo smartctl --test=short $Device' exited with error code $lastExitCode" }
|
||||
} else {
|
||||
$Details = (smartctl --all --json $Device) | ConvertFrom-Json
|
||||
$null = (smartctl --test=short $Device)
|
||||
@ -73,4 +71,4 @@ try {
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user