lots of cleanup
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
If ( Is64Bit ) { $BlueScreenView = $Global:ToolsDirectory + '\BlueScreenView-x64.exe' } Else { $BlueScreenView = $Global:ToolsDirectory + '\BlueScreenView-x86.exe' }
|
||||
$BSODReport = $Global:OutputDirectory + '\BSODReport.txt'
|
||||
If ( !(Test-Path $BlueScreenView) ) { Write-Error "File does not exist: ${BlueScreenView}" ; Return }
|
||||
|
||||
# Remove existing BSOD report
|
||||
If ( Test-Path $BSODReport ) { Remove-Item $BSODReport -Force -ErrorAction SilentlyContinue }
|
||||
$BSODReport = $Global:OutputDirectory + '\BSODReport.txt'
|
||||
If ( Test-Path $BSODReport ) { Write-Output "Deleting existing BSOD report: ${BSODReport}" ; Remove-Item $BSODReport -Force -ErrorAction SilentlyContinue }
|
||||
|
||||
# Run BlueScreenView
|
||||
If ( !(Test-Path $BlueScreenView) ) { Write-Error "File does not exist: ${BlueScreenView}" ; Return }
|
||||
Start-Process $BlueScreenView -ArgumentList "/stext $BSODReport /sort ~1" -Wait
|
||||
Start-Process $BlueScreenView -ArgumentList "/stext ${BSODReport} /sort ~1" -Wait
|
||||
|
||||
# Wait for BSOD report
|
||||
For ($i = 0; $i -lt 1200; $i++) {
|
||||
@@ -33,19 +33,11 @@ $ProviderMicrosoft = 'Microsoft|Windows'
|
||||
# Get the provider data from the most recent BSOD
|
||||
$CulpritProvider = $BSODReportContent[12..13] -join '`n'
|
||||
|
||||
# Set the billable time
|
||||
$BillableTimeInMinutes = 15
|
||||
$StartAt = (Get-Date).AddMinutes(-$BillableTimeInMinutes).ToString("o")
|
||||
|
||||
Switch ( $CulpritProvider ) {
|
||||
{ $_ -match $ProviderMicrosoft } {
|
||||
New-TicketComment -Comment "I've analyzed the crash report and it indicates a problem with a Windows component. I'll repair the system now."
|
||||
$TimeEntryNote = "Analysis indicates crash caused by Windows component(s). Scanning and repairing corruption in the system."
|
||||
Create-Syncro-Ticket-TimerEntry -TicketIdOrNumber $TicketID -StartTime $StartAt -DurationMinutes $BillableTimeInMinutes -Notes $TimeEntryNote -UserIdOrEmail $TimeAttributedToUser -ChargeTime "true"
|
||||
$FixWindowsHealth = Download-File -URL 'https://dev.emberkom.com/emberkom/management-scripts/raw/branch/master/Fix-WindowsHealth.ps1'
|
||||
Start-Sleep -Seconds 120
|
||||
. $FixWindowsHealth
|
||||
If ( Test-Path $FixWindowsHealth ) { Remove-Item $FixWindowsHealth -Force -ErrorAction SilentlyContinue }
|
||||
New-TicketTimerEntry -Comment "Analysis indicates crash caused by Windows component(s). Scanning and repairing corruption in the system."
|
||||
Source-PSScript -ScriptName "Fix-WindowsHealth"
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user