exit early if the BSOD report is empty
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user