exit early if the BSOD report is empty

This commit is contained in:
2024-07-18 15:42:41 -04:00
parent 2885d975f4
commit 298b8ef050
+7
View File
@@ -17,6 +17,13 @@ For ($i = 0; $i -lt 1200; $i++) {
# Exit if the BSOD report was not created
If ( !(Test-Path $BSODReport) ) { Write-Output "BSOD report was not found: ${BSODReport}" ; Return }
# Exit if the BSOD report is empty
If ( (Get-Content -Path $BSODReport).Length -eq 0 ) {
Write-Output "BSOD report is empty: ${BSODReport}"
Remove-Item $BSODReport -Force
Return
}
# Create ticket
$BSODReportContent = $(Get-Content -Path $BSODReport) -join "`n"
New-RMMTicket -Subject "System Crash on ${Env:COMPUTERNAME}" -InitialIssue $BSODReportContent