After executing the command I get bombarded with errors
Describe the bug After I type iwr -useb https://christitus.com/win | iex into the powershell as adminstrator I get these errors: iex : At line:9066 char:5
-
class WingetFailedInstall : Exception { -
~~~~~
Class keyword is not allowed in ConstrainedLanguage mode. At line:9066 char:11
-
class WingetFailedInstall : Exception { -
~~~~~~~~~~~~~~~~~~~
Unexpected token 'WingetFailedInstall' in expression or statement. At line:9072 char:5
-
class ChocoFailedInstall : Exception { -
~~~~~
Class keyword is not allowed in ConstrainedLanguage mode. At line:9072 char:11
-
class ChocoFailedInstall : Exception { -
~~~~~~~~~~~~~~~~~~
Unexpected token 'ChocoFailedInstall' in expression or statement. At line:9078 char:5
-
class GenericException : Exception { -
~~~~~
Class keyword is not allowed in ConstrainedLanguage mode. At line:9078 char:11
-
class GenericException : Exception { -
~~~~~~~~~~~~~~~~
Unexpected token 'GenericException' in expression or statement. At line:1 char:40
- iwr -useb https://christitus.com/win | iex
-
~~~- CategoryInfo : ParserError: (:) [Invoke-Expression], ParseException
- FullyQualifiedErrorId : ClassesNotAllowedInConstrainedLanguage,Microsoft.PowerShell.Commands.InvokeExpressionCom mand
To Reproduce Steps to reproduce the behavior:
- Go to 'powershell as adminstrator'
- Click on 'paste iwr -useb https://christitus.com/win | iex'
- Scroll down to 'see the errors'
- See error
Expected behavior Seeing the program open as shown in many videos
Screenshots
Additional context Add any other context about the problem here.
At line:9066 char:5
class WingetFailedInstall : Exception {~~~~~Class keyword is not allowed in ConstrainedLanguage mode. At line:9066 char:11
class WingetFailedInstall : Exception {~~~~~~~~~~~~~~~~~~~Unexpected token 'WingetFailedInstall' in expression or statement. At line:9072 char:5
class ChocoFailedInstall : Exception {~~~~~Class keyword is not allowed in ConstrainedLanguage mode. At line:9072 char:11
class ChocoFailedInstall : Exception {~~~~~~~~~~~~~~~~~~Unexpected token 'ChocoFailedInstall' in expression or statement. At line:9078 char:5
class GenericException : Exception {~~~~~Class keyword is not allowed in ConstrainedLanguage mode. At line:9078 char:11
class GenericException : Exception {~~~~~~~~~~~~~~~~Unexpected token 'GenericException' in expression or statement. At line:1 char:40
iwr -useb https://christitus.com/win | iex
~~~
- CategoryInfo : ParserError: (:) [Invoke-Expression], ParseException
- FullyQualifiedErrorId : ClassesNotAllowedInConstrainedLanguage,Microsoft.PowerShell.Commands.InvokeExpressionCom mand
Test the following commands:
$ExecutionContext.SessionState.LanguageMode
- If it's set to
ConstrainedLanguage, you may try running$ExecutionContext.SessionState.LanguageMode = "FullLanguage"in that session then attempting to run the utility again. (irm christitus.com/win | iex)
and
Get-ExecutionPolicy
- If this is set to something other than
Unrestricted, you may try runningSet-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Unrestrictedin that session then attempting to run the utility again. (irm christitus.com/win | iex)
At line:9066 char:5
class WingetFailedInstall : Exception {~~~~~Class keyword is not allowed in ConstrainedLanguage mode. At line:9066 char:11
class WingetFailedInstall : Exception {~~~~~~~~~~~~~~~~~~~Unexpected token 'WingetFailedInstall' in expression or statement. At line:9072 char:5
class ChocoFailedInstall : Exception {~~~~~Class keyword is not allowed in ConstrainedLanguage mode. At line:9072 char:11
class ChocoFailedInstall : Exception {~~~~~~~~~~~~~~~~~~Unexpected token 'ChocoFailedInstall' in expression or statement. At line:9078 char:5
class GenericException : Exception {~~~~~Class keyword is not allowed in ConstrainedLanguage mode. At line:9078 char:11
class GenericException : Exception {~~~~~~~~~~~~~~~~Unexpected token 'GenericException' in expression or statement. At line:1 char:40
iwr -useb https://christitus.com/win | iex
~~~
- CategoryInfo : ParserError: (:) [Invoke-Expression], ParseException
- FullyQualifiedErrorId : ClassesNotAllowedInConstrainedLanguage,Microsoft.PowerShell.Commands.InvokeExpressionCom mand
Test the following commands:
$ExecutionContext.SessionState.LanguageMode* If it's set to `ConstrainedLanguage`, you may try running `$ExecutionContext.SessionState.LanguageMode = "FullLanguage"` in that session then attempting to run the utility again. (`irm christitus.com/win | iex`)and
Get-ExecutionPolicy* If this is set to something other than `Unrestricted`, you may try running `Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Unrestricted` in that session then attempting to run the utility again. (`irm christitus.com/win | iex`)
Thank you, language mode is constrained but when I try to run the command to solve it gives these errors: Cannot set property. Property setting is supported only on core types in this language mode. At line:1 char:1
- $ExecutionContext.SessionState.LanguageMode = "FullLanguage"
-
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId : PropertySetterNotSupportedInConstrainedLanguage
Try reversing the command order here:
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Unrestricted->$ExecutionContext.SessionState.LanguageMode = "FullLanguage"
Same error...
Nvm I managed to solve it because I remembered I put on these safety features mentioned in this video https://www.youtube.com/watch?v=zW69MisrsWk&t
Closed due to inactivity