ok, i found the way to do it:
SMART:
$rcadm = "C:\Program Files (x86)\RAIDXpert2\rcadm.exe"
$Status = & $rcadm -M -q -d *| Select-Object -Skip 12 | ForEach-Object {
New-Object -Type PSObject -Property @{
'Disk' = [int]$_.Substring(0, 4).Trim()
'State' = $_.Substring(5, 8).Trim()
'ModelNumber' = $_.Substring(88, 26).Trim()
'SN' = $_.Substring(124).Trim()
}
} | Select-String -Pattern "Online" -notMatch
if ( $Status ) {
write-host "Failed: $STATUS"
exit 1
}
else {
write-host "Status OK"
exit 0
}
RAID:
$rcadm = "C:\Program Files (x86)\RAIDXpert2\rcadm.exe"
$Status = & $rcadm -M -q -a * | Select-Object -Skip 12 | ForEach-Object {
New-Object -Type PSObject -Property @{
'Type' = $_.Substring(3, 8).Trim()
'Task' = $_.Substring(69, 12).Trim()
}
} | Select-String -Pattern "NOT_ACTIVE" -notMatch
if ( $Status ) {
write-host "Failed: $STATUS"
exit 1
}
else {
write-host "Status OK"
exit 0
}
it is quite simple, but it fit my needs.