bill ticket
This commit is contained in:
+14
-5
@@ -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)
|
||||||
@@ -56,4 +62,7 @@ If ( $ScheduleCheckDisk ) {
|
|||||||
} Else {
|
} Else {
|
||||||
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