Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Windows RT Powershell (PermissionDenied) on New-Object

Tags:

powershell

I am trying to instantiate an object in Powershell for Windows RT, but keep getting the following error.

PS > $foo = New-Object System.Security.Cryptography.SHA1Managed
New-Object : Cannot create type. Only core types are supported in this language mode.
At line:1 char:8
+ $foo = New-Object System.Security.Cryptography.SHA1Managed
+        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : PermissionDenied: (:) [New-Object], PSNotSupportedException
    + FullyQualifiedErrorId : CannotCreateTypeConstrainedLanguage,Microsoft.PowerShell.Commands.NewObjectCommand

I just spent the last thirty minutes engaged in some pretty heavy Google-fu and was unable to find anything even close to a similar problem, let alone an answer. My hope is that I just need to configure something; my fear is that Windows RT ships with a crippled version of Powershell.

Does anyone know which case it is?

like image 742
dbazile Avatar asked Nov 22 '12 01:11

dbazile


1 Answers

Yup, Windows RT ships with a locked down version of PowerShell - it operates in ConstrainedLanguageMode which prevents most interaction (prop setters/method calls) with .NET. It also has a limited command set IIRC.

like image 143
Keith Hill Avatar answered Oct 18 '22 06:10

Keith Hill