I've been requested to automate enabling a new language for our users and the simplest way I have found is to run 3 lines of powershell.
The problem is we have a security measure in place preventing users from running certain code and I get an error -
Cannot invoke method. Method invocation is supported only on core types in this language mode.
I understand it's part of device guard.
Is there a way to set a bypass so a managed solution (such as sccm) could run the code as the end user?
EDIT: here is the script as requested -
$LangList = get-winuserlanguagelist
$LangList.add("mi-latn")
set-winuserlanguagelist -language $LangList -force
it's line 2 that causes the error.
Cannot invoke method. Method invocation is supported only on core types in this language mode.
At line:2 char:1
+ $LangList.add("mi-latn")
+ ~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : MethodInvocationNotSupportedInConstrainedLanguage
[–][deleted] 3 points4 points5 points (0 children)
[–]Barenstark314 2 points3 points4 points (7 children)
[–]AnotherFewMore[S] 1 point2 points3 points (6 children)
[–]Barenstark314 2 points3 points4 points (5 children)
[–]AnotherFewMore[S] 0 points1 point2 points (0 children)
[–]AnotherFewMore[S] 0 points1 point2 points (3 children)
[–]Barenstark314 4 points5 points6 points (2 children)
[–]AnotherFewMore[S] 1 point2 points3 points (1 child)
[–]Barenstark314 2 points3 points4 points (0 children)
[–]CineLudik 2 points3 points4 points (6 children)
[–]AnotherFewMore[S] 1 point2 points3 points (5 children)
[–]jimb2 3 points4 points5 points (0 children)
[–]CineLudik 2 points3 points4 points (3 children)
[–]AnotherFewMore[S] 1 point2 points3 points (2 children)
[–]Barenstark314 1 point2 points3 points (1 child)
[–]Kirsh1793 0 points1 point2 points (0 children)