tacticalrmm/scripts_wip/Win_Hardware_Disk_SMART_Pas...

18 lines
323 B
PowerShell
Raw Normal View History

2021-09-02 12:39:03 +00:00
$ErrorActionPreference= 'silentlycontinue'
$smartst = (Get-WmiObject -namespace root\wmi -class MSStorageDriver_FailurePredictStatus).PredictFailure
if ($smartst = 'False')
{
Write-Output "Theres no SMART Failures predicted"
exit 0
}
else
{
Write-Output "There are SMART Failures detected"
exit 1
}
Exit $LASTEXITCODE