diff --git a/Fix-WindowsHealth.ps1 b/Fix-WindowsHealth.ps1 index 66d0358..107adaa 100644 --- a/Fix-WindowsHealth.ps1 +++ b/Fix-WindowsHealth.ps1 @@ -11,6 +11,7 @@ If ( $SFCOutput -contains 'Windows Resource Protection did not find any integrit # Run enhanced DISM for Windows 8 and higher endpoints If ( IsWindowsVersion -ge "6.2" ) { + # Record start of DISM repair $BeginDISMRun = (Get-Date) Write-Output "Beginning repair of Windows Component Store" @@ -19,9 +20,10 @@ If ( IsWindowsVersion -ge "6.2" ) Write-Output "Beginning cleanup of superceded components in Windows Component Store" Start-Process "dism.exe" -ArgumentList "/online /cleanup-image /startcomponentcleanup" -Wait - $EndDISMRun = $(Get-Date).AddSeconds(1) + # Record end of DISM repair + $EndDISMRun = (Get-Date) - # Adding results of DISM log file to this log file + # Extract results of DISM repair from system log and add them to this log Write-Output "Beginning Windows Component Store log data collection" Get-Content -Path "${Env:WinDir}\Logs\DISM\dism.log" | Select-String -Pattern '^(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})' | ForEach-Object {