From 904e96d748045bec1c3f5bb4eba2373b47be5777 Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Mon, 4 Aug 2025 02:05:13 +0530 Subject: Check .NET corruption --- MAS/Separate-Files-Version/Troubleshoot.cmd | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'MAS/Separate-Files-Version/Troubleshoot.cmd') diff --git a/MAS/Separate-Files-Version/Troubleshoot.cmd b/MAS/Separate-Files-Version/Troubleshoot.cmd index 9ce97a2..6c29b5a 100644 --- a/MAS/Separate-Files-Version/Troubleshoot.cmd +++ b/MAS/Separate-Files-Version/Troubleshoot.cmd @@ -241,9 +241,25 @@ REM check Powershell core version cmd /c "%psc% "$PSVersionTable.PSEdition"" | find /i "Core" %nul1% && ( echo Windows Powershell is needed for MAS but it seems to be replaced with Powershell core. Aborting... +echo: +set fixes=%fixes% %mas%in-place_repair_upgrade +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%in-place_repair_upgrade" goto dk_done ) +REM check if .NET is working properly + +if /i "!tstresult2!"=="FullLanguage" ( +cmd /c "%psc% ""try {[System.AppDomain]::CurrentDomain.GetAssemblies(); [System.Math]::Sqrt(144)} catch {Exit 3}""" %nul% +if !errorlevel!==3 ( +echo Windows Powershell failed to load .NET command. Aborting... +echo: +set fixes=%fixes% %mas%in-place_repair_upgrade +call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%in-place_repair_upgrade" +goto dk_done +) +) + REM check for Mal-ware that may cause issues with Powershell for /r "%ProgramFiles%\" %%f in (secureboot.exe) do if exist "%%f" ( @@ -261,7 +277,7 @@ echo PowerShell is not working properly. Aborting... if /i "!tstresult2!"=="FullLanguage" ( echo: -echo Your antivirus software might be blocking the script, or PowerShell on your system might be corrupted. +echo Your antivirus software might be blocking the script. echo: sc query sense | find /i "RUNNING" %nul% && ( echo Installed Antivirus - Microsoft Defender for Endpoint -- cgit v1.2.3