Compare commits
2
Commits
6904647871
...
96c3e03b89
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
96c3e03b89 | ||
|
|
e872cdf02a |
@@ -36,7 +36,6 @@ $CulpritProvider = $BSODReportContent[12..13] -join '`n'
|
|||||||
Switch ( $CulpritProvider ) {
|
Switch ( $CulpritProvider ) {
|
||||||
{ $_ -match $ProviderMicrosoft } {
|
{ $_ -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."
|
New-TicketComment -Comment "I've analyzed the crash report and it indicates a problem with a Windows component. I'll repair the system now."
|
||||||
New-TicketTimerEntry -Comment "Analysis indicates crash caused by Windows component(s). Scanning and repairing corruption in the system."
|
|
||||||
Source-PSScript -ScriptName "Fix-WindowsHealth"
|
Source-PSScript -ScriptName "Fix-WindowsHealth"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+13
-4
@@ -21,16 +21,22 @@ Switch ( $SFCOutput ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Run enhanced DISM for Windows 8 and higher endpoints
|
# Run enhanced DISM for Windows 8 and higher endpoints
|
||||||
|
$DISMRun = $false
|
||||||
If ( IsWindowsVersion -ge "6.2" ) {
|
If ( IsWindowsVersion -ge "6.2" ) {
|
||||||
|
|
||||||
# Record start of DISM repair
|
# Record start of DISM repair
|
||||||
$BeginDISMRun = (Get-Date)
|
$BeginDISMRun = (Get-Date)
|
||||||
|
|
||||||
Write-Output "Beginning repair of Windows Component Store"
|
Try {
|
||||||
Start-Process "dism.exe" -ArgumentList "/online /cleanup-image /restorehealth" -Wait
|
Write-Output "Beginning repair of Windows Component Store"
|
||||||
|
Start-Process "dism.exe" -ArgumentList "/online /cleanup-image /restorehealth" -Wait
|
||||||
|
|
||||||
Write-Output "Beginning cleanup of superceded components in Windows Component Store"
|
Write-Output "Beginning cleanup of superceded components in Windows Component Store"
|
||||||
Start-Process "dism.exe" -ArgumentList "/online /cleanup-image /startcomponentcleanup" -Wait
|
Start-Process "dism.exe" -ArgumentList "/online /cleanup-image /startcomponentcleanup" -Wait
|
||||||
|
|
||||||
|
$DISMRun = $true
|
||||||
|
}
|
||||||
|
Catch { Write-Error $_.Exception.Message }
|
||||||
|
|
||||||
# Record end of DISM repair
|
# Record end of DISM repair
|
||||||
$EndDISMRun = (Get-Date)
|
$EndDISMRun = (Get-Date)
|
||||||
@@ -57,3 +63,6 @@ If ( $ScheduleCheckDisk ) {
|
|||||||
New-TicketComment -Comment "Disk check was not scheduled to run, as no Windows integrity violations were found." -Hidden -DoNotEmail
|
New-TicketComment -Comment "Disk check was not scheduled to run, as no Windows integrity violations were found." -Hidden -DoNotEmail
|
||||||
New-TicketComment -Comment "Your computer has been repaired. Please restart as soon as you're able."
|
New-TicketComment -Comment "Your computer has been repaired. Please restart as soon as you're able."
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Bill ticket if action was taken
|
||||||
|
If ( $DISMRun -or $ScheduleCheckDisk ) { New-TicketTimerEntry -Comment "Corruption was found and has been repaired." }
|
||||||
Reference in New Issue
Block a user