Browse Source

Update Powershell error detection code

dev
WindowsAddict 3 weeks ago
parent
commit
a99acbb025
  1. 16
      MAS/All-In-One-Version-KL/MAS_AIO.cmd
  2. 16
      MAS/Separate-Files-Version/Activators/HWID_Activation.cmd
  3. 16
      MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd
  4. 16
      MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd
  5. 16
      MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd
  6. 16
      MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd
  7. 16
      MAS/Separate-Files-Version/Change_Office_Edition.cmd
  8. 16
      MAS/Separate-Files-Version/Change_Windows_Edition.cmd
  9. 16
      MAS/Separate-Files-Version/Extract_OEM_Folder.cmd
  10. 16
      MAS/Separate-Files-Version/Troubleshoot.cmd

16
MAS/All-In-One-Version-KL/MAS_AIO.cmd

@ -219,12 +219,14 @@ for /f "delims=" %%a in ('%psc% "if ($PSVersionTable.PSEdition -ne 'Core') {$f=[
if /i not "%tstresult%"=="FullLanguage" ( if /i not "%tstresult%"=="FullLanguage" (
%eline% %eline%
echo: %tstresult% for /f "delims=" %%a in ('%psc% "$ExecutionContext.SessionState.LanguageMode" %nul6%') do (set tstresult2=%%a)
cmd /c "%psc% $ExecutionContext.SessionState.LanguageMode" echo Test 1 - %tstresult%
echo Test 2 - !tstresult2!
echo:
REM check LanguageMode REM check LanguageMode
cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" | findstr /i "ConstrainedLanguage RestrictedLanguage NoLanguage" %nul1% && ( echo: !tstresult2! | findstr /i "ConstrainedLanguage RestrictedLanguage NoLanguage" %nul1% && (
echo FullLanguage mode not found in PowerShell. Aborting... echo FullLanguage mode not found in PowerShell. Aborting...
echo If you have applied restrictions on Powershell then undo those changes. echo If you have applied restrictions on Powershell then undo those changes.
echo: echo:
@ -254,7 +256,13 @@ goto dk_done
REM check antivirus and other errors REM check antivirus and other errors
echo PowerShell is not working properly. Aborting... echo PowerShell is not working properly. Aborting...
cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { if ($i.displayName -notlike '*windows*') { $n += $i.displayName } }; if ($n) { Write-Host ('Installed 3rd party Antivirus might be blocking the script - ' + ($n -join ', ')) -ForegroundColor White -BackgroundColor Blue }"""
if /i "!tstresult2!"=="FullLanguage" (
echo:
echo Your antivirus software might be blocking the script, or PowerShell on your system might be corrupted.
cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { $n += $i.displayName }; if ($n) { Write-Host ('Installed Antivirus - ' + ($n -join ', '))}"""
)
echo: echo:
set fixes=%fixes% %mas%troubleshoot set fixes=%fixes% %mas%troubleshoot
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot"

16
MAS/Separate-Files-Version/Activators/HWID_Activation.cmd

@ -241,12 +241,14 @@ for /f "delims=" %%a in ('%psc% "if ($PSVersionTable.PSEdition -ne 'Core') {$f=[
if /i not "%tstresult%"=="FullLanguage" ( if /i not "%tstresult%"=="FullLanguage" (
%eline% %eline%
echo: %tstresult% for /f "delims=" %%a in ('%psc% "$ExecutionContext.SessionState.LanguageMode" %nul6%') do (set tstresult2=%%a)
cmd /c "%psc% $ExecutionContext.SessionState.LanguageMode" echo Test 1 - %tstresult%
echo Test 2 - !tstresult2!
echo:
REM check LanguageMode REM check LanguageMode
cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" | findstr /i "ConstrainedLanguage RestrictedLanguage NoLanguage" %nul1% && ( echo: !tstresult2! | findstr /i "ConstrainedLanguage RestrictedLanguage NoLanguage" %nul1% && (
echo FullLanguage mode not found in PowerShell. Aborting... echo FullLanguage mode not found in PowerShell. Aborting...
echo If you have applied restrictions on Powershell then undo those changes. echo If you have applied restrictions on Powershell then undo those changes.
echo: echo:
@ -276,7 +278,13 @@ goto dk_done
REM check antivirus and other errors REM check antivirus and other errors
echo PowerShell is not working properly. Aborting... echo PowerShell is not working properly. Aborting...
cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { if ($i.displayName -notlike '*windows*') { $n += $i.displayName } }; if ($n) { Write-Host ('Installed 3rd party Antivirus might be blocking the script - ' + ($n -join ', ')) -ForegroundColor White -BackgroundColor Blue }"""
if /i "!tstresult2!"=="FullLanguage" (
echo:
echo Your antivirus software might be blocking the script, or PowerShell on your system might be corrupted.
cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { $n += $i.displayName }; if ($n) { Write-Host ('Installed Antivirus - ' + ($n -join ', '))}"""
)
echo: echo:
set fixes=%fixes% %mas%troubleshoot set fixes=%fixes% %mas%troubleshoot
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot"

16
MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd

@ -244,12 +244,14 @@ for /f "delims=" %%a in ('%psc% "if ($PSVersionTable.PSEdition -ne 'Core') {$f=[
if /i not "%tstresult%"=="FullLanguage" ( if /i not "%tstresult%"=="FullLanguage" (
%eline% %eline%
echo: %tstresult% for /f "delims=" %%a in ('%psc% "$ExecutionContext.SessionState.LanguageMode" %nul6%') do (set tstresult2=%%a)
cmd /c "%psc% $ExecutionContext.SessionState.LanguageMode" echo Test 1 - %tstresult%
echo Test 2 - !tstresult2!
echo:
REM check LanguageMode REM check LanguageMode
cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" | findstr /i "ConstrainedLanguage RestrictedLanguage NoLanguage" %nul1% && ( echo: !tstresult2! | findstr /i "ConstrainedLanguage RestrictedLanguage NoLanguage" %nul1% && (
echo FullLanguage mode not found in PowerShell. Aborting... echo FullLanguage mode not found in PowerShell. Aborting...
echo If you have applied restrictions on Powershell then undo those changes. echo If you have applied restrictions on Powershell then undo those changes.
echo: echo:
@ -279,7 +281,13 @@ goto dk_done
REM check antivirus and other errors REM check antivirus and other errors
echo PowerShell is not working properly. Aborting... echo PowerShell is not working properly. Aborting...
cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { if ($i.displayName -notlike '*windows*') { $n += $i.displayName } }; if ($n) { Write-Host ('Installed 3rd party Antivirus might be blocking the script - ' + ($n -join ', ')) -ForegroundColor White -BackgroundColor Blue }"""
if /i "!tstresult2!"=="FullLanguage" (
echo:
echo Your antivirus software might be blocking the script, or PowerShell on your system might be corrupted.
cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { $n += $i.displayName }; if ($n) { Write-Host ('Installed Antivirus - ' + ($n -join ', '))}"""
)
echo: echo:
set fixes=%fixes% %mas%troubleshoot set fixes=%fixes% %mas%troubleshoot
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot"

16
MAS/Separate-Files-Version/Activators/Ohook_Activation_AIO.cmd

@ -249,12 +249,14 @@ for /f "delims=" %%a in ('%psc% "if ($PSVersionTable.PSEdition -ne 'Core') {$f=[
if /i not "%tstresult%"=="FullLanguage" ( if /i not "%tstresult%"=="FullLanguage" (
%eline% %eline%
echo: %tstresult% for /f "delims=" %%a in ('%psc% "$ExecutionContext.SessionState.LanguageMode" %nul6%') do (set tstresult2=%%a)
cmd /c "%psc% $ExecutionContext.SessionState.LanguageMode" echo Test 1 - %tstresult%
echo Test 2 - !tstresult2!
echo:
REM check LanguageMode REM check LanguageMode
cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" | findstr /i "ConstrainedLanguage RestrictedLanguage NoLanguage" %nul1% && ( echo: !tstresult2! | findstr /i "ConstrainedLanguage RestrictedLanguage NoLanguage" %nul1% && (
echo FullLanguage mode not found in PowerShell. Aborting... echo FullLanguage mode not found in PowerShell. Aborting...
echo If you have applied restrictions on Powershell then undo those changes. echo If you have applied restrictions on Powershell then undo those changes.
echo: echo:
@ -284,7 +286,13 @@ goto dk_done
REM check antivirus and other errors REM check antivirus and other errors
echo PowerShell is not working properly. Aborting... echo PowerShell is not working properly. Aborting...
cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { if ($i.displayName -notlike '*windows*') { $n += $i.displayName } }; if ($n) { Write-Host ('Installed 3rd party Antivirus might be blocking the script - ' + ($n -join ', ')) -ForegroundColor White -BackgroundColor Blue }"""
if /i "!tstresult2!"=="FullLanguage" (
echo:
echo Your antivirus software might be blocking the script, or PowerShell on your system might be corrupted.
cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { $n += $i.displayName }; if ($n) { Write-Host ('Installed Antivirus - ' + ($n -join ', '))}"""
)
echo: echo:
set fixes=%fixes% %mas%troubleshoot set fixes=%fixes% %mas%troubleshoot
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot"

16
MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd

@ -280,12 +280,14 @@ for /f "delims=" %%a in ('%psc% "if ($PSVersionTable.PSEdition -ne 'Core') {$f=[
if /i not "%tstresult%"=="FullLanguage" ( if /i not "%tstresult%"=="FullLanguage" (
%eline% %eline%
echo: %tstresult% for /f "delims=" %%a in ('%psc% "$ExecutionContext.SessionState.LanguageMode" %nul6%') do (set tstresult2=%%a)
cmd /c "%psc% $ExecutionContext.SessionState.LanguageMode" echo Test 1 - %tstresult%
echo Test 2 - !tstresult2!
echo:
REM check LanguageMode REM check LanguageMode
cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" | findstr /i "ConstrainedLanguage RestrictedLanguage NoLanguage" %nul1% && ( echo: !tstresult2! | findstr /i "ConstrainedLanguage RestrictedLanguage NoLanguage" %nul1% && (
echo FullLanguage mode not found in PowerShell. Aborting... echo FullLanguage mode not found in PowerShell. Aborting...
echo If you have applied restrictions on Powershell then undo those changes. echo If you have applied restrictions on Powershell then undo those changes.
echo: echo:
@ -315,7 +317,13 @@ goto dk_done
REM check antivirus and other errors REM check antivirus and other errors
echo PowerShell is not working properly. Aborting... echo PowerShell is not working properly. Aborting...
cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { if ($i.displayName -notlike '*windows*') { $n += $i.displayName } }; if ($n) { Write-Host ('Installed 3rd party Antivirus might be blocking the script - ' + ($n -join ', ')) -ForegroundColor White -BackgroundColor Blue }"""
if /i "!tstresult2!"=="FullLanguage" (
echo:
echo Your antivirus software might be blocking the script, or PowerShell on your system might be corrupted.
cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { $n += $i.displayName }; if ($n) { Write-Host ('Installed Antivirus - ' + ($n -join ', '))}"""
)
echo: echo:
set fixes=%fixes% %mas%troubleshoot set fixes=%fixes% %mas%troubleshoot
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot"

16
MAS/Separate-Files-Version/Activators/TSforge_Activation.cmd

@ -298,12 +298,14 @@ for /f "delims=" %%a in ('%psc% "if ($PSVersionTable.PSEdition -ne 'Core') {$f=[
if /i not "%tstresult%"=="FullLanguage" ( if /i not "%tstresult%"=="FullLanguage" (
%eline% %eline%
echo: %tstresult% for /f "delims=" %%a in ('%psc% "$ExecutionContext.SessionState.LanguageMode" %nul6%') do (set tstresult2=%%a)
cmd /c "%psc% $ExecutionContext.SessionState.LanguageMode" echo Test 1 - %tstresult%
echo Test 2 - !tstresult2!
echo:
REM check LanguageMode REM check LanguageMode
cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" | findstr /i "ConstrainedLanguage RestrictedLanguage NoLanguage" %nul1% && ( echo: !tstresult2! | findstr /i "ConstrainedLanguage RestrictedLanguage NoLanguage" %nul1% && (
echo FullLanguage mode not found in PowerShell. Aborting... echo FullLanguage mode not found in PowerShell. Aborting...
echo If you have applied restrictions on Powershell then undo those changes. echo If you have applied restrictions on Powershell then undo those changes.
echo: echo:
@ -333,7 +335,13 @@ goto dk_done
REM check antivirus and other errors REM check antivirus and other errors
echo PowerShell is not working properly. Aborting... echo PowerShell is not working properly. Aborting...
cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { if ($i.displayName -notlike '*windows*') { $n += $i.displayName } }; if ($n) { Write-Host ('Installed 3rd party Antivirus might be blocking the script - ' + ($n -join ', ')) -ForegroundColor White -BackgroundColor Blue }"""
if /i "!tstresult2!"=="FullLanguage" (
echo:
echo Your antivirus software might be blocking the script, or PowerShell on your system might be corrupted.
cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { $n += $i.displayName }; if ($n) { Write-Host ('Installed Antivirus - ' + ($n -join ', '))}"""
)
echo: echo:
set fixes=%fixes% %mas%troubleshoot set fixes=%fixes% %mas%troubleshoot
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot"

16
MAS/Separate-Files-Version/Change_Office_Edition.cmd

@ -194,12 +194,14 @@ for /f "delims=" %%a in ('%psc% "if ($PSVersionTable.PSEdition -ne 'Core') {$f=[
if /i not "%tstresult%"=="FullLanguage" ( if /i not "%tstresult%"=="FullLanguage" (
%eline% %eline%
echo: %tstresult% for /f "delims=" %%a in ('%psc% "$ExecutionContext.SessionState.LanguageMode" %nul6%') do (set tstresult2=%%a)
cmd /c "%psc% $ExecutionContext.SessionState.LanguageMode" echo Test 1 - %tstresult%
echo Test 2 - !tstresult2!
echo:
REM check LanguageMode REM check LanguageMode
cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" | findstr /i "ConstrainedLanguage RestrictedLanguage NoLanguage" %nul1% && ( echo: !tstresult2! | findstr /i "ConstrainedLanguage RestrictedLanguage NoLanguage" %nul1% && (
echo FullLanguage mode not found in PowerShell. Aborting... echo FullLanguage mode not found in PowerShell. Aborting...
echo If you have applied restrictions on Powershell then undo those changes. echo If you have applied restrictions on Powershell then undo those changes.
echo: echo:
@ -229,7 +231,13 @@ goto dk_done
REM check antivirus and other errors REM check antivirus and other errors
echo PowerShell is not working properly. Aborting... echo PowerShell is not working properly. Aborting...
cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { if ($i.displayName -notlike '*windows*') { $n += $i.displayName } }; if ($n) { Write-Host ('Installed 3rd party Antivirus might be blocking the script - ' + ($n -join ', ')) -ForegroundColor White -BackgroundColor Blue }"""
if /i "!tstresult2!"=="FullLanguage" (
echo:
echo Your antivirus software might be blocking the script, or PowerShell on your system might be corrupted.
cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { $n += $i.displayName }; if ($n) { Write-Host ('Installed Antivirus - ' + ($n -join ', '))}"""
)
echo: echo:
set fixes=%fixes% %mas%troubleshoot set fixes=%fixes% %mas%troubleshoot
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot"

16
MAS/Separate-Files-Version/Change_Windows_Edition.cmd

@ -199,12 +199,14 @@ for /f "delims=" %%a in ('%psc% "if ($PSVersionTable.PSEdition -ne 'Core') {$f=[
if /i not "%tstresult%"=="FullLanguage" ( if /i not "%tstresult%"=="FullLanguage" (
%eline% %eline%
echo: %tstresult% for /f "delims=" %%a in ('%psc% "$ExecutionContext.SessionState.LanguageMode" %nul6%') do (set tstresult2=%%a)
cmd /c "%psc% $ExecutionContext.SessionState.LanguageMode" echo Test 1 - %tstresult%
echo Test 2 - !tstresult2!
echo:
REM check LanguageMode REM check LanguageMode
cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" | findstr /i "ConstrainedLanguage RestrictedLanguage NoLanguage" %nul1% && ( echo: !tstresult2! | findstr /i "ConstrainedLanguage RestrictedLanguage NoLanguage" %nul1% && (
echo FullLanguage mode not found in PowerShell. Aborting... echo FullLanguage mode not found in PowerShell. Aborting...
echo If you have applied restrictions on Powershell then undo those changes. echo If you have applied restrictions on Powershell then undo those changes.
echo: echo:
@ -234,7 +236,13 @@ goto dk_done
REM check antivirus and other errors REM check antivirus and other errors
echo PowerShell is not working properly. Aborting... echo PowerShell is not working properly. Aborting...
cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { if ($i.displayName -notlike '*windows*') { $n += $i.displayName } }; if ($n) { Write-Host ('Installed 3rd party Antivirus might be blocking the script - ' + ($n -join ', ')) -ForegroundColor White -BackgroundColor Blue }"""
if /i "!tstresult2!"=="FullLanguage" (
echo:
echo Your antivirus software might be blocking the script, or PowerShell on your system might be corrupted.
cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { $n += $i.displayName }; if ($n) { Write-Host ('Installed Antivirus - ' + ($n -join ', '))}"""
)
echo: echo:
set fixes=%fixes% %mas%troubleshoot set fixes=%fixes% %mas%troubleshoot
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot"

16
MAS/Separate-Files-Version/Extract_OEM_Folder.cmd

@ -210,12 +210,14 @@ for /f "delims=" %%a in ('%psc% "if ($PSVersionTable.PSEdition -ne 'Core') {$f=[
if /i not "%tstresult%"=="FullLanguage" ( if /i not "%tstresult%"=="FullLanguage" (
%eline% %eline%
echo: %tstresult% for /f "delims=" %%a in ('%psc% "$ExecutionContext.SessionState.LanguageMode" %nul6%') do (set tstresult2=%%a)
cmd /c "%psc% $ExecutionContext.SessionState.LanguageMode" echo Test 1 - %tstresult%
echo Test 2 - !tstresult2!
echo:
REM check LanguageMode REM check LanguageMode
cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" | findstr /i "ConstrainedLanguage RestrictedLanguage NoLanguage" %nul1% && ( echo: !tstresult2! | findstr /i "ConstrainedLanguage RestrictedLanguage NoLanguage" %nul1% && (
echo FullLanguage mode not found in PowerShell. Aborting... echo FullLanguage mode not found in PowerShell. Aborting...
echo If you have applied restrictions on Powershell then undo those changes. echo If you have applied restrictions on Powershell then undo those changes.
echo: echo:
@ -245,7 +247,13 @@ goto done2
REM check antivirus and other errors REM check antivirus and other errors
echo PowerShell is not working properly. Aborting... echo PowerShell is not working properly. Aborting...
cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { if ($i.displayName -notlike '*windows*') { $n += $i.displayName } }; if ($n) { Write-Host ('Installed 3rd party Antivirus might be blocking the script - ' + ($n -join ', ')) -ForegroundColor White -BackgroundColor Blue }"""
if /i "!tstresult2!"=="FullLanguage" (
echo:
echo Your antivirus software might be blocking the script, or PowerShell on your system might be corrupted.
cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { $n += $i.displayName }; if ($n) { Write-Host ('Installed Antivirus - ' + ($n -join ', '))}"""
)
echo: echo:
set fixes=%fixes% %mas%troubleshoot set fixes=%fixes% %mas%troubleshoot
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot"

16
MAS/Separate-Files-Version/Troubleshoot.cmd

@ -211,12 +211,14 @@ for /f "delims=" %%a in ('%psc% "if ($PSVersionTable.PSEdition -ne 'Core') {$f=[
if /i not "%tstresult%"=="FullLanguage" ( if /i not "%tstresult%"=="FullLanguage" (
%eline% %eline%
echo: %tstresult% for /f "delims=" %%a in ('%psc% "$ExecutionContext.SessionState.LanguageMode" %nul6%') do (set tstresult2=%%a)
cmd /c "%psc% $ExecutionContext.SessionState.LanguageMode" echo Test 1 - %tstresult%
echo Test 2 - !tstresult2!
echo:
REM check LanguageMode REM check LanguageMode
cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" | findstr /i "ConstrainedLanguage RestrictedLanguage NoLanguage" %nul1% && ( echo: !tstresult2! | findstr /i "ConstrainedLanguage RestrictedLanguage NoLanguage" %nul1% && (
echo FullLanguage mode not found in PowerShell. Aborting... echo FullLanguage mode not found in PowerShell. Aborting...
echo If you have applied restrictions on Powershell then undo those changes. echo If you have applied restrictions on Powershell then undo those changes.
echo: echo:
@ -246,7 +248,13 @@ goto dk_done
REM check antivirus and other errors REM check antivirus and other errors
echo PowerShell is not working properly. Aborting... echo PowerShell is not working properly. Aborting...
cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { if ($i.displayName -notlike '*windows*') { $n += $i.displayName } }; if ($n) { Write-Host ('Installed 3rd party Antivirus might be blocking the script - ' + ($n -join ', ')) -ForegroundColor White -BackgroundColor Blue }"""
if /i "!tstresult2!"=="FullLanguage" (
echo:
echo Your antivirus software might be blocking the script, or PowerShell on your system might be corrupted.
cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { $n += $i.displayName }; if ($n) { Write-Host ('Installed Antivirus - ' + ($n -join ', '))}"""
)
echo: echo:
set fixes=%fixes% %mas%troubleshoot set fixes=%fixes% %mas%troubleshoot
call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot"

Loading…
Cancel
Save