bill ticket

This commit is contained in:
2024-07-03 17:09:35 -04:00
parent e872cdf02a
commit 96c3e03b89
+14 -5
View File
@@ -21,16 +21,22 @@ Switch ( $SFCOutput ) {
}
# Run enhanced DISM for Windows 8 and higher endpoints
$DISMRun = $false
If ( IsWindowsVersion -ge "6.2" ) {
# Record start of DISM repair
$BeginDISMRun = (Get-Date)
Write-Output "Beginning repair of Windows Component Store"
Start-Process "dism.exe" -ArgumentList "/online /cleanup-image /restorehealth" -Wait
Try {
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"
Start-Process "dism.exe" -ArgumentList "/online /cleanup-image /startcomponentcleanup" -Wait
Write-Output "Beginning cleanup of superceded components in Windows Component Store"
Start-Process "dism.exe" -ArgumentList "/online /cleanup-image /startcomponentcleanup" -Wait
$DISMRun = $true
}
Catch { Write-Error $_.Exception.Message }
# Record end of DISM repair
$EndDISMRun = (Get-Date)
@@ -56,4 +62,7 @@ If ( $ScheduleCheckDisk ) {
} Else {
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."
}
}
# Bill ticket if action was taken
If ( $DISMRun -or $ScheduleCheckDisk ) { New-TicketTimerEntry -Comment "Corruption was found and has been repaired." }