diff --git a/Documentation/changelog.md b/Documentation/changelog.md index 43c038e..d72f9ce 100644 --- a/Documentation/changelog.md +++ b/Documentation/changelog.md @@ -1,35 +1,13 @@ # Changelog.md - pcHealth -## 12-10-2023 - @REALSDEALS +## 02-11-2023 - @REALSDEALS -Redirected the function to use the VBS script to the Desktop location, instead of the Documents folder; this change has been made because of the following reason: -- Users are instructed to download the script to the Desktop, so it would be easier to use the script. +In this release the Powershell capability has been removed from the script. +This is due to the fact that .bat won't be supported in upcoming releases of Windows. Or the rumors are there that it won't be supported anymore. -## 9-10-2023 - @REALSDEALS +Because of the fact that .bat might not survive the next Windows release (W12.) I will be archiving this repository and will be working on a new project regarding the functionality of pcHealth but in Powershell. This repository will be named pcHealthPlus. -Added some new simple functions to the script. -- TRACERT to user provided URL. (Number 13 in the Tools menu.) -- IPCONFIG to display the IP address of the system. (Number 14 in the Tools menu.) - -Added a auto run VBS option to the Programs menu. - -## 10-07-2023 - @REALSDEALS - -Checked the script and reviewed it, it seems to be working fine. -Will be releasing a new, full version soon. - -## 25-05-2023 - @REALSDEALS & @Stensel8 - -Created a issue, issue is about the following: -- The log file couldn't be openend after the log file was created due to a typo in the code. @Stensel8 fixed this issue. - -Besides that the code has had some revisions, some quality of life changes have been made and it's made a little bit easier on how to use function 13 in the tools menu. - -Thanks again for helping me out @Stensel8! - -## 11-04-2023 - @REALSDEALS - -Added a function so the user can designate his/her own url to trace/ping. +I'm currently in the first phase of the project, so it will take some time before it will be released. ## 29-03-2023 - @REALSDEALS @@ -38,8 +16,6 @@ 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. -Updated documentation regarding to version numbers etc. - ## 26-01-2023 - @BigoStream Centered the title from the menu that you are currently in. diff --git a/Documentation/releases.md b/Documentation/releases.md index 2a427bb..e9a1f75 100644 --- a/Documentation/releases.md +++ b/Documentation/releases.md @@ -5,9 +5,9 @@ For now only the version names will be displayed, in the future there might be e # Current Version(s) -Full Release - v1.5.9 (Stable) -Beta Release - v1.6.10-beta -Alpha Release - v0.3.0-alpha (PowerShell) +Full Release - v1.6.0 (Stable) +Beta Release - v1.6.5-beta +Alpha Release - v0.2.1-alpha (PowerShell) ## Older Releases @@ -15,6 +15,7 @@ Here you can see a overview of the older version. ### Full Release(s) +- Full Release - v1.6.0 - Full Release - v1.5.9 - Full Release - v1.5.8 - Full Release - v1.5.6 @@ -31,11 +32,6 @@ Here you can see a overview of the older version. ### Beta Release(s) -- Beta Release - v1.6.10-beta -- Beta Release - v1.6.9-beta -- Beta Release - v1.6.8-beta -- Beta Release - v1.6.7-beta -- Beta Release - v1.6.6-beta - Beta Release - v1.6.5-beta - Beta Release - v1.6.4-beta - Beta Release - v1.6.3-beta @@ -77,7 +73,5 @@ Here you can see a overview of the older version. ### Alpha Release(s) - pcHealth.ps1 -- Alpha Release - v0.3.0-alpha -- Alpha Release - v0.2.1-alpha - Alpha Release - v0.1.1-alpha - Alpha Release - v0.1.0-alpha \ No newline at end of file diff --git a/README.md b/README.md index feaec1c..fe418af 100644 --- a/README.md +++ b/README.md @@ -16,12 +16,14 @@ It really means a lot to me! If you have any tips/tricks or remarks? Feel free to contact me on discord: REALSDEALS#6353 +Sidenote: since version 1.6 and onwards, the Powershell section has been removed from the script. To read more about this decision, please read the changelog. + ### More information regarding on how to install and use it: - Download this repository. -- Extract it to the DESKTOP to be sure that it will run with full permissions. -- Open the `scripts` folder and choose your preferred method by choosing the `CMD` or `PowerShell` folder. -- Open the file in the chosen folder and read the rules carefully. +- Extract it to the desktop to be sure that it will run with full permissions. +- Open the `scripts` folder and open the CMD folder in there. +- Open the file in the CMD folder and read the rules/commands carefully. - Enter in the number of the desired command that you want to run. (Number + ENTER) - Patiently wait for the script to finish. - You can chose, depending on the command, what you want to do next. (Open logs ect.) @@ -48,19 +50,17 @@ Otherwise I can keep no promise to that statement. 10. Short ping test. (Do I have internet?) 11. Continues ping test. (Does my internet stop at certain times?) 12. Starts the function 'TRACERT' and traces how many hops your system has to make before establishing an connection with the host. (Google) -13. Starts the function 'TRACERT' and traces how many hops your system has to make before establishing an connection with the host. (URL User Provided) -14. Starts the function 'IPCONFIG' and shows you the IP address of your system. -15. Fetches updates for system programs, updates them too if needed. -16. Re-enables the drivers, it restarts the audio drivers. (Having issues with sound?) -17. Re-open the battery report. (Can't find my generated report anymore? Try opening it this way) -18. Re-open the CBS.log (DISM log, report from option 4.) -19. Get your Ninite! (Standard program downloader/updater; Chrome, Edge, VLC and 7Zip) -20. Check your Windows License Key. -21. BIOS password recovery. -22. Shutdown, reboot and/or logout from the system. -23. Open the other menu, it's called 'Programs'. -24. Returning to the previous menu, main-menu. -25. Close the script. +13. Fetches updates for system programs, updates them too if needed. +14. Re-enables the drivers, it restarts the audio drivers. (Having issues with sound?) +15. Re-open the battery report. (Can't find my generated report anymore? Try opening it this way) +16. Re-open the CBS.log (DISM log, report from option 4.) +17. Get your Ninite! (Standard program downloader/updater; Chrome, Edge, VLC and 7Zip) +18. Check your Windows License Key. +19. BIOS password recovery. +20. Shutdown, reboot and/or logout from the system. +21. Open the other menu, it's called 'Programs'. +22. Returning to the previous menu, main-menu. +23. Close the script. #### Programs menu: @@ -74,10 +74,9 @@ I understand if people have their questions about that decision, but I wanted to 3. DiskInfo64 - This program will check information about your HDD/SDD (serial etc.) 4. DiskMark64 - This program will test your HDD/SDD on possible malfunctions. 5. Prime95 - This program will stress test your CPU. -6. (TEST) - Auto run VBS script. -7. Return to the previous menu. -8. Open the other menu, it's called 'Tools'. -9. Close the script. +6. Return to the previous menu. +7. Open the other menu, it's called 'Tools'. +8. Close the script. #### KeyGrabber The key grabber script does what it says! diff --git a/Scripts/CMD/pcHealth.bat b/Scripts/CMD/pcHealth.bat index c201c80..a3ff085 100644 --- a/Scripts/CMD/pcHealth.bat +++ b/Scripts/CMD/pcHealth.bat @@ -26,10 +26,10 @@ if '%errorlevel%' NEQ '0' ( :gotAdmin pushd "%CD%" CD /D "%~dp0" -:-------------------------------------- +:-------------------------------------- :: MainCode @echo off -title pcHealth - Check your PC's Health! - version 1.6.11-beta +title pcHealth - Check your PC's Health! - version 1.7.0 cd / color D cls @@ -42,7 +42,7 @@ echo Thanks for downloading and using pcHealth! echo Please be sure that you are running this Batch file in Administrator mode. echo. echo Made by REALSDEALS - Licensed under GNU-3 (You are free to use, but not to change or to remove this line.) -echo You are now using version 1.6.11-beta +echo You are now using version 1.7.0 of pcHealth. echo. echo %DATE%, %TIME% echo. @@ -63,7 +63,7 @@ IF %A%==4 GOTO PRERELEASE IF %A%==5 GOTO CLOSE :TOOLS -cls +cls color 09 echo. echo You are now in the Tools menu: @@ -81,19 +81,17 @@ echo Enter number 9 to start Disk cleaner to clean your drive(s). (Windows Funct echo Enter number 10 to start a short ping test. echo Enter number 11 to start a continues ping test. echo Enter number 12 to start a trace route to Google. -echo Enter number 13 to start a trace route to a designated place. -echo Enter number 14 to check your IP adresses. -echo Enter number 15 to update system programs. -echo Enter number 16 to re-start the audio drivers of your system. -echo Enter number 17 to re-open the generated battery report file. -echo Enter number 18 to re-open the CBS.log (AKA DISM.log) -echo Enter number 19 to get your Ninite! Includes Edge, Chrome, VLC and 7Zip. -echo Enter number 20 to see your systems Windows License key. -echo Enter number 21 BIOS Password Recovery. -echo Enter number 22 to shutdown, reboot or log off from your PC/laptop. -echo Enter number 23 to open the programs menu. -echo Enter number 24 to return to the previous menu. -echo Enter number 25 to close this batch file. +echo Enter number 13 to update system programs. +echo Enter number 14 to re-start the audio drivers of your system. +echo Enter number 15 to re-open the generated battery report file. +echo Enter number 16 to re-open the CBS.log (AKA DISM.log) +echo Enter number 17 to get your Ninite! Includes Edge, Chrome, VLC and 7Zip. +echo Enter number 18 to see your systems Windows License key. +echo Enter number 19 BIOS Password Recovery. +echo Enter number 20 to shutdown, reboot or log off from your PC/laptop. +echo Enter number 21 to open the programs menu. +echo Enter number 22 to return to the previous menu. +echo Enter number 23 to close this batch file. echo ........................................................... echo. @@ -110,19 +108,17 @@ IF %B%==9 GOTO CLMGR IF %B%==10 GOTO SHORTPING IF %B%==11 GOTO CONTINUESPING IF %B%==12 GOTO TRACEGOOGLE -IF %B%==13 GOTO TRACEDESIG -IF %B%==14 GOTO IPCONFIG -IF %B%==15 GOTO SYSUPDATE -IF %B%==16 GOTO AUDIORE -IF %B%==17 GOTO BATOPEN -IF %B%==18 GOTO OPENCBSLOG -IF %B%==19 GOTO NINITE -IF %B%==20 GOTO LICENSE -IF %B%==21 GOTO BIOSPW -IF %B%==22 GOTO RESHUT -IF %B%==23 GOTO PROGRAMS -IF %B%==24 GOTO MENU -IF %B%==25 GOTO CLOSE +IF %B%==13 GOTO SYSUPDATE +IF %B%==14 GOTO AUDIORE +IF %B%==15 GOTO BATOPEN +IF %B%==16 GOTO OPENCBSLOG +IF %B%==17 GOTO NINITE +IF %B%==18 GOTO LICENSE +IF %B%==19 GOTO BIOSPW +IF %B%==20 GOTO RESHUT +IF %B%==21 GOTO PROGRAMS +IF %B%==22 GOTO MENU +IF %B%==23 GOTO CLOSE :PROGRAMS cls @@ -136,10 +132,9 @@ echo Enter number 2 to get ADW Cleaner. echo Enter number 3 to get DiskInfo64. echo Enter number 4 to get DiskMark64. echo Enter number 5 to get Prime95. -echo Enter number 6 to open the VBS script. -echo Enter number 7 to open the tools menu. -echo Enter number 8 to return to the previous menu. -echo Enter number 9 to close the script. +echo Enter number 6 to open the tools menu. +echo Enter number 7 to return to the previous menu. +echo Enter number 8 to close the script. echo ........................................................... echo. @@ -149,10 +144,9 @@ IF %AB%==2 GOTO ADWCLEANER IF %AB%==3 GOTO DISKINFODOWN IF %AB%==4 GOTO DISKMARKDOWN IF %AB%==5 GOTO PRIMEDOWN -IF %AB%==6 GOTO VBS -IF %AB%==7 GOTO TOOLS -IF %AB%==8 GOTO MENU -IF %AB%==9 GOTO CLOSE +IF %AB%==6 GOTO TOOLS +IF %AB%==7 GOTO MENU +IF %AB%==8 GOTO CLOSE :SYSUPDATE cls @@ -190,8 +184,8 @@ IF %D%==4 GOTO CLOSE :CPUANDGPUINFO cls -color 0A -echo. +color 0A +echo. echo Your CPU information: echo. wmic cpu get caption, deviceid, name, numberofcores, maxclockspeed, status @@ -295,9 +289,9 @@ IF %L%==3 GOTO CLOSE :DFR cls color 0A -dfrgui.exe +dfrgui.exe pause -echo. +echo. SET /P LK=Enter number 1 to return to the previous sub-menu, enter number 2 to return to the main-menu or enter number 3 to exit the script. Enter: IF %L%==1 GOTO TOOLS IF %L%==2 GOTO MENU @@ -308,7 +302,7 @@ cls color 0A cleanmgr.exe pause -echo. +echo. SET /P LKT=Enter number 1 to return to the previous sub-menu, enter number 2 to return to the main-menu or enter number 3 to exit the script. Enter: IF %L%==1 GOTO TOOLS IF %L%==2 GOTO MENU @@ -317,7 +311,7 @@ IF %L%==3 GOTO CLOSE :SHORTPING cls color 0A -ping 8.8.8.8 +ping 8.8.8.8 pause echo. SET /P M=Enter number 1 to return to the previous sub-menu, enter number 2 to return to the main-menu, enter number 3 to start a continues ping test or enter number 4 to exit the script. Enter: @@ -351,68 +345,10 @@ IF %NM%==1 GOTO TOOLS IF %NM%==2 GOTO MENU IF %NM%==3 GOTO CLOSE -:TRACEDESIG -cls -color 0A -echo. -echo Please enter a URL to start a trace route: (example: www.google.com) -echo. -set /p ip=Tell me your target: -echo %ip% -pause -IF "%ip%" equ "" ( - cls & color 4f - echo This is not a correct URL or route to trace, please try again. - pause - exit - ) ELSE ( - cls - echo Code will be executed, give it a hot minute... - echo tracing... - tracert %IP% > "C:\trace-%ip%.txt" - echo pinging... - ping %IP% > "C:\ping-%ip%.txt" - ) - pause - SET /P OPEN=Enter 1 to open the C directory of your pc where the files are located, enter 2 to open the logs; 2 .txt files will open, enter 3 to return to the main menu or enter number 4 to close the script. Enter: -IF %OPEN%==1 ( - start %windir%\explorer.exe "C:\" - pause - GOTO MENU - ) - IF %OPEN%==2 GOTO EXECLOG - IF %OPEN%==3 GOTO MENU - IF %OPEN%==4 GOTO CLOSE - -:IPCONFIG -cls -color 0A -echo. -ipconfig /all -pause -echo. -SET /P PO=Enter number 1 to return to the previous sub-menu, enter number 2 to return to the main-menu or enter number 3 to exit the script. Enter: -IF %PO%==1 GOTO TOOLS -IF %PO%==2 GOTO MENU -IF %PO%==3 GOTO CLOSE - - -:EXECLOG -cls -color 0A -echo. -start %windir%\explorer.exe "C:\trace-%ip%.txt" & start %windir%\explorer.exe "C:\ping-%ip%.txt" -pause -echo. -SET /P OP=Enter number 1 to return to the previous sub-menu, enter number 2 to return to the main-menu or enter number 3 to exit the script. Enter: -IF %OP%==1 GOTO TOOLS -IF %OP%==2 GOTO MENU -IF %OP%==3 GOTO CLOSE - :AUDIORE cls color 0A -if "%1"=="am_admin" (powershell start -verb runas '%0' am_admin) +if "%1"=="am_admin" (powershell start -verb runas '%0' am_admin) net stop audiosrv net stop AudioEndPointBuilder net start AudioEndPointBuilder @@ -448,7 +384,7 @@ IF %P%==3 GOTO CLOSE :NINITE cls color 0A -start "" https://ninite.com/7zip-chrome-edge-vlc/ninite.exe +start "" https://ninite.com/7zip-chrome-edge-vlc/ninite.exe pause echo. SET /P Q=Enter number 1 to return to the previous sub-menu, enter number 2 to return to the main-menu or enter number 3 to exit the script. Enter: @@ -480,9 +416,9 @@ color 0E echo. echo The BIOS Password Recovery tool is a website that can be used to gather/generate a recovery code for the BIOS. echo. -echo If you don't know how to use this function/website, then +echo If you don't know how to use this function/website, then echo I would suggest that you enter '2' on the next line to learn more. -echo. +echo. echo The credits for this function and repository goes to the owner: @bacher09 echo. SET /P SK=Enter number 1 to visit the website, enter number 2 to go to the repository of BIOS-PW and learn more! Enter number 3 to return to the sub-menu, enter number 4 to return to the main-menu or enter number 5 to close the script. Enter: @@ -490,12 +426,12 @@ IF %SK%==1 start "" https://bios-pw.org && GOTO BIOSPW IF %SK%==2 start "" https://github.com/bacher09/pwgen-for-bios && GOTO BIOSPW IF %SK%==3 GOTO TOOLS IF %SK%==4 GOTO MENU -IF %SK%==5 GOTO CLOSE +IF %SK%==5 GOTO CLOSE :RESHUT cls color 0A -echo. +echo. SET /P S=If you want to log off from your PC/Laptop enter number 1, to restart enter number 2, to shutdown enter number 3 and to return to the previous sub-menu enter number 4 or to exit the script... enter number 5. Enter: IF %S%==1 GOTO LOGOFF1 IF %S%==2 GOTO RESTART2 @@ -505,18 +441,18 @@ IF %S%==5 GOTO CLOSE :LOGOFF1 cls -color 0A -echo. +color 0A +echo. SET /P T=Are you sure that you want to log off your PC? Enter number 1, enter number 2 to return to the previous sub-menu, enter number 3 to return to the main-menu or enter number 4 to exit the script. Enter: IF %T%==1 GOTO LOGOFFCONFIRM1 IF %T%==2 GOTO TOOLS -IF %T%==3 GOTO MENU +IF %T%==3 GOTO MENU IF %T%==4 GOTO CLOSE :LOGOFFCONFIRM1 cls -color 0A -shutdown /l +color 0A +shutdown /l EXIT /B :RESTART2 @@ -531,17 +467,17 @@ IF %U%==4 GOTO CLOSE :RESTARTCONFIRM2 cls -color 0A +color 0A shutdown /r EXIT /B :SHUTDOWN3 cls color 0A -echo. +echo. SET /P V=Are you sure that you want to shutdown your PC? Enter number 1, to continue. Enter number 2 to return to the previous sub-menu, enter number 3 to return to the main-menu or enter number 4 to exit the script. Enter: IF %V%==1 GOTO SHUTDOWNCONFIRM3 -IF %V%==2 GOTO TOOLS +IF %V%==2 GOTO TOOLS IF %V%==3 GOTO MENU IF %V%==4 GOTO CLOSE @@ -568,7 +504,7 @@ color 0A echo. echo Your download will start now! echo. -start "" https://github.com/REALSDEALS/pcHealth/archive/refs/heads/main.zip +start "" https://github.com/REALSDEALS/pcHealth/archive/refs/heads/main.zip echo. SET /P AD=To return to the sub-menu enter 1, to return to the main menu enter 2 or to close the script enter 3. Enter: IF %AD%==1 GOTO PROGRAMS @@ -587,7 +523,7 @@ SET /P AP=To return to the sub-menu enter 1, to return to the main menu enter 2 IF %AP%==1 GOTO PROGRAMS IF %AP%==2 GOTO MENU IF %AP%==3 GOTO CLOSE - + :HARDINFODOWN cls color 0A @@ -595,7 +531,7 @@ echo. echo Are you sure that you want to download the newest version of Hardware Info? echo. SET /P AE=If yes, enter the number 1, if not enter number 2 to return to the sub-menu. Enter: -IF %AE%==1 GOTO HARDINFODOWNLOADLINK +IF %AE%==1 GOTO HARDINFODOWNLOADLINK IF %AE%==2 GOTO PROGRAMS :HARDINFODOWNLOADLINK @@ -616,7 +552,7 @@ cls color 0A echo. echo Are you sure that you want to download the latest version of ADW Cleaner? -echo. +echo. SET /P AG=If yes enter the number 1 to start the download, enter number 2 to return to the previous sub-menu. Enter: IF %AG%==1 GOTO ADWCLEANERDOWNLOADLINK IF %AG%==2 GOTO PROGRAMS @@ -624,7 +560,7 @@ IF %AG%==2 GOTO PROGRAMS :ADWCLEANERDOWNLOADLINK cls color 0A -echo. +echo. echo Your download will start now! echo. start "" https://downloads.malwarebytes.com/file/adwcleaner @@ -637,9 +573,9 @@ IF %AH%==3 GOTO CLOSE :DISKINFODOWN cls color 0A -echo. +echo. echo Are you sure that you want to download the latest version of Disk Info? -echo. +echo. SET /P AI=If yes enter the number 1 to start the download, enter the number 2 to return to the previous sub-menu. Enter: IF %AI%==1 GOTO DISKINFODOWNLOADLINK IF %AI%==2 GOTO PROGRAMS @@ -659,9 +595,9 @@ IF %AJ%==3 GOTO CLOSE :DISKMARKDOWN cls color 0A -echo. +echo. echo Are you sure that you want to download the latest version of Disk Mark? -echo. +echo. SET /P AK=If yes enter the number 1 to start the download, enter the number 2 to return to the previous sub-menu. Enter: IF %AK%==1 GOTO DISKMARKDOWNLOADLINK IF %AK%==2 GOTO PROGRAMS @@ -681,9 +617,9 @@ IF %AL%==3 GOTO CLOSE :PRIMEDOWN cls color 0A -echo. +echo. echo Are you sure that you want to download the latest version of Prime95? Enter: -echo. +echo. SET /P AM=If yes enter the number 1 to start the download, enter the number 2 to return to the previous sub-menu. IF %AM%==1 GOTO PRIMEDOWNLOADLINK IF %AM%==2 GOTO PROGRAMS @@ -704,7 +640,7 @@ IF %AN%==3 GOTO CLOSE cls color 0A echo. -echo Are you sure that you want to try out a pre-release? +echo Are you sure that you want to try out a pre-release? echo. echo SET /P AO=If yes you could enter number 1 to be redirected to our version page on GitHub, we would like to recieve feedback on your experience with a pre-release build! Because it could help us out, improving our script! You can enter number 2 to return to the main menu or you could enter number 3 to close the script. Enter: @@ -721,28 +657,6 @@ start "" https://github.com/REALSDEALS/pcHealth/releases echo. GOTO MENU -:VBS -cls -color 0A -echo. -echo Are you sure that you want to open the VBS script? -echo. -SET /P AP=If yes enter the number 1 to open the VBS script, enter number 2 to return to the previous sub-menu. Enter: -IF %AP%==1 GOTO VBSOPEN -IF %AP%==2 GOTO PROGRAMS - -:VBSOPEN -cls -color 0A -echo. -echo Your VBS script will open now! -echo. -start "" "C:\Users\%username%\Desktop\pcHealth\Scripts\VBS\KeyGrabber.vbs" -echo. -SET /P AQ=To return to the previous sub-menu enter 1, enter number 2 to return to the main-menu or enter number 3 to exit the script. Enter: -IF %AQ%==1 GOTO PROGRAMS -IF %AQ%==2 GOTO MENU -IF %AQ%==3 GOTO CLOSE :CLOSE EXIT /B \ No newline at end of file diff --git a/Scripts/PowerShell/pcHealth.ps1 b/Scripts/PowerShell/pcHealth.ps1 deleted file mode 100644 index dcf0563..0000000 --- a/Scripts/PowerShell/pcHealth.ps1 +++ /dev/null @@ -1,149 +0,0 @@ -Clear-Host -Write-Host "" -Write-Host "Thanks for downloading and using pcHealth!" -Write-Host "" -Write-Host "This PowerShell script is made by REALSDEALS" -Write-Host "Licensed under GNU-3 (You are free to use, but not to change or to remove this line.)" -Write-Host "" -Write-Host "You are now using PowerShell version v0.3.0-alpha" -Write-Host "" -cd c:/ - -function isAdmin { - #Check if the user runs this script as Administrator. - If (-NOT ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) { - # Relaunch as an elevated process: - Start-Process powershell.exe "-File", ('"{0}"' -f $MyInvocation.MyCommand.Path) -Verb RunAs - exit - } - # Now running elevated so launch the script: - & "c:\long path name\script name.ps1" "Long Argument 1" "Long Argument 2" -} - -function Show-Menu { - param ( - [string]$Title = 'pcHealth | v0.3.0-alpha' - ) - Clear-Host - Write-Host "" - Write-Host "================ $Title ================" - Write-Host "" - Write-Host "1: ENTER '1' TO GATHER SYSTEM INFORMATION" - Write-Host "2: ENTER '2' TO CHECK WHICH CPU AND GPU ARE IN THE SYSTEM" - 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 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 { - Show-Menu - $selection = Read-Host "Enter the number of the instance that you want to run." - switch ($selection) { - '1' { - Write-Host "" - Write-Host "Computer information will be generated..." - Get-ComputerInfo - Write-Host "" - pause - } '2' { - Write-Host "" - Write-Host "Your CPU information:" - Get-WmiObject -Class Win32_Processor -ComputerName $env:COMPUTERNAME - Write-Host "" - Write-Host "Your GPU information:" - Get-WmiObject win32_VideoController | Format-List Name - Write-Host "" - pause - } '3' { - Write-Host "" - sfc /scannow - Write-Host "" - pause - } '4' { - 'Sorry, this option has no function yet.' - pause - } '5' { - 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 - } '8' { - Write-Host "" - control update - Write-Host "" - pause - } '9' { - Write-Host "" - ping 8.8.8.8 - Write-Host "" - pause - } '10' { - Write-Host "" - ping 8.8.8.8 -t -l 256 - Write-Host "" - 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 - } '14' { - Write-Host "" - Write-Host "Your system will be restarted." - Restart-Computer - Write-Host "" - pause - } '15' { - Write-Host "" - Write-Host "pc-Health.ps will be terminated." - Write-Host "" - pause - } - } -} -until ($selection -eq 'q') -Pause