Update DiskStatus.ps1
Checks local disks for errors reported in event viewer within the last 24 hours
This commit is contained in:
parent
43263a1650
commit
9badea0b3c
|
@ -5,7 +5,7 @@ $TimeSpan = (Get-Date) - (New-TimeSpan -Day 1)
|
|||
if (Get-WinEvent -FilterHashtable @{LogName='system';ID='11','9','15','52','129','7','98';Level=2,3;ProviderName='*disk*','*storsvc*','*ntfs*';StartTime=$TimeSpan})
|
||||
|
||||
{
|
||||
Write-Host "Disk errors detected please investigate"
|
||||
Write-Output "Disk errors detected please investigate"
|
||||
Get-WinEvent -FilterHashtable @{LogName='system';ID='11','9','15','52','129','7','98';Level=2,3;ProviderName='*disk*','*storsvc*','*ntfs*';StartTime=$TimeSpan}
|
||||
exit 1
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ exit 1
|
|||
|
||||
else
|
||||
{
|
||||
Write-Host "Disks are Healthy"
|
||||
Write-Output "Disks are Healthy"
|
||||
exit 0
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue