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
|
# Exit if the BSOD report was not created
|
||||||
If ( !(Test-Path $BSODReport) ) { Write-Output "BSOD report was not found: ${BSODReport}" ; Return }
|
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
|
# Create ticket
|
||||||
$BSODReportContent = $(Get-Content -Path $BSODReport) -join "`n"
|
$BSODReportContent = $(Get-Content -Path $BSODReport) -join "`n"
|
||||||
New-RMMTicket -Subject "System Crash on ${Env:COMPUTERNAME}" -InitialIssue $BSODReportContent
|
New-RMMTicket -Subject "System Crash on ${Env:COMPUTERNAME}" -InitialIssue $BSODReportContent
|
||||||
|
|||||||
Reference in New Issue
Block a user