Skip to content

Commit

Permalink
Add: DiskCheck, DISM and SFC
Browse files Browse the repository at this point in the history
Add: Added functionality to the .PS script. DiskCheck, DISM and SFC have been intergrated.

Function 5 and 6 in the pcHealth.ps script.
  • Loading branch information
REALSDEALS committed Mar 28, 2023
1 parent 027b4a7 commit cdb3edc
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 20 deletions.
7 changes: 7 additions & 0 deletions Documentation/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog.md - pcHealth

## 29-03-2023 - @REALSDEALS

Added some new functionality to the PowerShell script.
It is now possible to use the 5th and 6th function.
--> The 5th function is almost the same as the 5th function from the pcHealth.bat script.
--> The 6th function will open the log after the 5th function has been ran.

## 26-01-2023 - @BigoStream

Centered the title from the menu that you are currently in.
Expand Down
65 changes: 45 additions & 20 deletions Scripts/PowerShell/pcHealth.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,17 @@ function Show-Menu {
Write-Host "3: ENTER '3' RUN A SYSTEM SCAN"
Write-Host "4: ENTER '4' TO TRY AND REPAIR CORRUPT FILES"
Write-Host "5: ENTER '5' TO RUN A SYSTEM SCAN AND START REPAIRING IN ONE GO"
Write-Host "6: ENTER '6' TO GENERATE A BATTERY REPORT"
Write-Host "7: ENTER '7' TO OPEN WINDOWS UPDATE(S)"
Write-Host "8: ENTER '8' TO START A SHORT PING TEST"
Write-Host "9: ENTER '9' TO START A CONTINUES PING TEST"
Write-Host "10: ENTER '10' TO RE-OPEN THE BATTERY REPORT"
Write-Host "11: ENTER '11' TO RE-OPEN THE CBS.log (DISM LOG)"
Write-Host "12: ENTER '12' TO GET YOUR NINITE (INCLUDES EDGE, CHROME, VLC AND 7ZIP)"
Write-Host "13: ENTER '13' TO RESTART OR SHUTDOWN YOUR LAPTOP/PC"
Write-Host "14: ENTER '14' TO SHUTDOWN YOUR LAPTOP/PC"
Write-Host "15: ENTER 'Q' TO CLOSE THIS POWERSHELL SCRIPT"
Write-Host "6: ENTER '6' TO OPEN THE GENERATED REPORT FROM FUNCTION 5"
Write-Host "7: ENTER '7' TO GENERATE A BATTERY REPORT"
Write-Host "8: ENTER '8' TO OPEN WINDOWS UPDATE(S)"
Write-Host "9: ENTER '9' TO START A SHORT PING TEST"
Write-Host "10: ENTER '10' TO START A CONTINUES PING TEST"
Write-Host "11: ENTER '11' TO RE-OPEN THE BATTERY REPORT"
Write-Host "12: ENTER '12' TO RE-OPEN THE CBS.log (DISM LOG)"
Write-Host "13: ENTER '13' TO GET YOUR NINITE (INCLUDES EDGE, CHROME, VLC AND 7ZIP)"
Write-Host "14: ENTER '14' TO RESTART OR SHUTDOWN YOUR LAPTOP/PC"
Write-Host "15: ENTER '15' TO SHUTDOWN YOUR LAPTOP/PC"
Write-Host "16: ENTER 'Q' TO CLOSE THIS POWERSHELL SCRIPT"
Write-Host ""
}
do {
Expand Down Expand Up @@ -73,46 +74,70 @@ do {
'Sorry, this option has no function yet.'
pause
} '5' {
'Sorry, this option has no function yet.'
pause
Write-Host ""
Write-Host "This could take a hot minute, script will run in the background."
Write-Host "When 'Press ENTER to continue' displays, you can press 'ENTER' to return to the main menu of the script."
Write-Host ""
$ReturnTo = cd /
$GenDir = mkdir pcHealthLog
$Path = 'C:\pcHealthLog'
$Date = get-date -format "dd-MM-yyyy"
$LogFile = "C:\pcHealthLog\LogResults.txt"
start-job -name DiskCheck -ScriptBlock { CHKDSK C: }
start-job -name DISM -ScriptBlock { DISM /Online /Cleanup-Image /RestoreHealth }
start-job -name SFC -ScriptBlock { sfc /scannow }
if (test-path $path) { write-host "`$Path was found, exporting logs to $Path" } else { new-item C:\pcHealthLog -itemtype directory; Write-Host "$Path not found, creating $Path and exporting logs" }
wait-job -name DiskCheck, DISM, SFC | receive-job | out-file -FilePath $LogFile
Write-Host ""
Write-Host "Don't forget to run script function 6 to open the log."
Write-Host ""
Pause
} '6' {
Write-Host ""
Write-Host "Attempting to open the log file..."
Write-Host ""
$ReturnTo = cd /
start "C:\pcHealthLog\LogResults.txt"
Write-Host ""
Pause
}'7' {
Write-Host ""
powercfg /batteryreport
start "C:\battery-report.html"
Write-Host ""
pause
} '7' {
} '8' {
Write-Host ""
control update
Write-Host ""
pause
} '8' {
} '9' {
Write-Host ""
ping 8.8.8.8
Write-Host ""
pause
} '9' {
} '10' {
Write-Host ""
ping 8.8.8.8 -t -l 256
Write-Host ""
pause
} '10' {
'Sorry, this option has no function yet.'
pause
} '11' {
'Sorry, this option has no function yet.'
pause
} '12' {
'Sorry, this option has no function yet.'
pause
} '13' {
Write-Host ""
start explorer.exe "https://ninite.com/7zip-chrome-edge-vlc/ninite.exe"
pause
} '13' {
} '14' {
Write-Host ""
Write-Host "Your system will be restarted."
Restart-Computer
Write-Host ""
pause
} '14' {
} '15' {
Write-Host ""
Write-Host "pc-Health.ps will be terminated."
Write-Host ""
Expand Down

0 comments on commit cdb3edc

Please sign in to comment.