-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfixupdate.ps1
62 lines (52 loc) · 2.3 KB
/
fixupdate.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# DISCLAIMER:
# This script is provided as is, with no warranty or guarantee of any kind.
# Use it at your own risk. It is always a good idea to back up your system
# before making any changes.
Write-Host "DISCLAIMER:" -ForegroundColor Yellow
Write-Host "This script is provided as is, with no warranty or guarantee of any kind." -ForegroundColor Yellow
Write-Host "Use it at your own risk. It is always a good idea to back up your system" -ForegroundColor Yellow
Write-Host "before making any changes." -ForegroundColor Yellow
$confirm = Read-Host "Do you understand and accept the disclaimer? (y/n)"
if ($confirm -ne "y") {
Write-Host "Exiting..."
exit
}
$Host.UI.RawUI.WindowTitle = "Windows Update Repair Tool"
Clear-Host
Write-Host "-------------------------------------------------------" -ForegroundColor Yellow
Write-Host " WINDOWS 10 UPDATE REPAIR TOOL" -ForegroundColor Yellow
Write-Host "-------------------------------------------------------" -ForegroundColor Yellow
Write-Host
Write-Host "Choose an option:" -ForegroundColor White
Write-Host "1. Repair missing or corrupted system files" -ForegroundColor White
Write-Host "2. Scan and repair common issues with the system image" -ForegroundColor White
Write-Host "3. Delete Windows update cache files" -ForegroundColor White
Write-Host "4. Check the file system for errors" -ForegroundColor White
Write-Host "5. Exit" -ForegroundColor White
$choice = Read-Host "Enter your choice"
switch ($choice) {
1 {
Checkpoint-Computer -Description "Repair missing or corrupted system files Restore Point"
SFC /SCANNOW
}
2 {
Checkpoint-Computer -Description "Scan and repair common issues with the system image Restore Point"
DISM.exe /Online /Cleanup-Image /Restorehealth
}
3 {
Checkpoint-Computer -Description "Delete Windows update cache files Restore Point"
$path = "C:\Windows\SoftwareDistribution"
Get-ChildItem -Path $path -Recurse | Remove-Item -Force -Recurse
}
4 {
Checkpoint-Computer -Description "Check the file system for errors Restore Point"
chkdsk /F /R /X /B /scan /offlinescanandfix
}
5 {
Write-Host "Exiting..." -ForegroundColor White
exit
}
default {
Write-Host "Invalid choice" -ForegroundColor Red
}
}