2021-03-16 18:13:30 +00:00
|
|
|
# This will check for Bluescreen events on your system
|
|
|
|
|
|
|
|
$ErrorActionPreference= 'silentlycontinue'
|
|
|
|
$TimeSpan = (Get-Date) - (New-TimeSpan -Day 1)
|
|
|
|
|
|
|
|
if (Get-WinEvent -FilterHashtable @{LogName='application';ID='1001';ProviderName='Windows Error Reporting';Level=4;Data='BlueScreen';StartTime=$TimeSpan})
|
|
|
|
|
|
|
|
{
|
|
|
|
Write-Output "There has been bluescreen events detected on your system"
|
|
|
|
Get-WinEvent -FilterHashtable @{LogName='application';ID='1001';ProviderName='Windows Error Reporting';Level=4;Data='BlueScreen';StartTime=$TimeSpan}
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
else
|
2021-04-01 00:11:45 +00:00
|
|
|
Write-Output "No bluescreen events detected in the past 24 hours."
|
2021-03-16 18:13:30 +00:00
|
|
|
exit 0
|
|
|
|
}
|
|
|
|
|
2021-04-01 00:11:45 +00:00
|
|
|
Exit $LASTEXITCODE
|