Added DISM command and button to tool (#19)

* Added DISM command and button to tool

* Added additional scans and colours to make it clear when each scan type starts

Co-authored-by: Chris Titus <dfm.titus@gmail.com>
This commit is contained in:
Jards 2022-05-18 01:43:43 +10:00 committed by GitHub
parent 0d7d75e300
commit 3393fba7d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1146,8 +1146,16 @@ $WPFFeatureInstall.Add_Click({
[System.Windows.MessageBox]::Show($Messageboxbody,$MessageboxTitle,$ButtonType,$MessageIcon)
})
$WPFPanelDISM.Add_Click({
Start-Process PowerShell -ArgumentList 'Write-Host "Chkdsk" -ForegroundColor Green; Chkdsk;
Write-Host "SFC - 1st scan" -ForegroundColor Green; sfc /scannow;
Write-Host "DISM" -ForegroundColor Green; DISM /Online /Cleanup-Image /Restorehealth;
Write-Host "SFC - 2nd scan" -ForegroundColor Green; sfc /scannow;
Read-Host "Press Enter"' -verb runas
})
$WPFPanelcontrol.Add_Click({
cmd /c control
cmd /c control
})
$WPFPanelnetwork.Add_Click({
cmd /c ncpa.cpl
@ -1271,6 +1279,8 @@ foreach ($service in $services) {
Stop-Service -Name wuauserv
Stop-Service -Name appidsvc
Stop-Service -Name cryptsvc
Write-Host "2. Remove QMGR Data file..."
Remove-Item "$env:allusersprofile\Application Data\Microsoft\Network\Downloader\qmgr*.dat" -ErrorAction SilentlyContinue