Cannot import powershell module in windows 8 release preview

Jun 12, 2012 at 9:04 PM
Edited Jun 12, 2012 at 9:07 PM

Hi, can you confirm that the current release works with windows 8 release preview? I'm trying to import the module as instructed but I get the error below:

PS C:\WINDOWS\system32> ipmo 'C:\Program Files\1\UIAutomation.0.7.6.NET35\UIAutomation.dll'
ipmo : Could not load file or assembly 'file:///C:\Program Files\1\UIAutomation.0.7.6.NET35\UIAutomation.dll' or one
of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)
At line:1 char:1
+ ipmo 'C:\Program Files\1\UIAutomation.0.7.6.NET35\UIAutomation.dll'
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Import-Module], FileLoadException
    + FullyQualifiedErrorId : System.IO.FileLoadException,Microsoft.PowerShell.Commands.ImportModuleCommand

The same steps work fine on my win7 machine. Could it have something to do with the fact that in win8, .NET 4.0 is used by default?

PS C:\WINDOWS\system32> $psversiontable

Name                           Value
----                           -----
PSVersion                      3.0
WSManStackVersion              3.0
SerializationVersion           1.1.0.1
CLRVersion                     4.0.30319.17626
BuildVersion                   6.2.8400.0
PSCompatibleVersions           {1.0, 2.0, 3.0}
PSRemotingProtocolVersion      2.2
Thanks!
Coordinator
Jun 12, 2012 at 9:34 PM

Hello,

I uploaded the .NET 4.0 version. I didn't test these binaries, because now I'm sitting on Windows 7 with PowerShell 2.0 (they should work as always).

Regarding your question, if you'd had the .NET 3.5 feature on, cmdlets would work on Windows 8. The .NET 4.0 version is for pure Windows 8 environments (if the configuration is a requirement).

 

If you need version for testing Metro UI, the latest is 0.7.5 (the ability to get a window by wildcarded name is, IMHO, not the biggest thing in Metro testing). If you need so, I can compile 0.7.6 Metro too.

Coordinator
Jun 13, 2012 at 12:12 PM

Well, there is definitely a problem. Code that was built on 7 (3.5) refuses to load into PowerShell 3.0 unless you are specifying the -version 2.0 command-line parameter.

Code that is built on 7 (4.0) can't be loaded at all. There is something missing for PowerShell 3.0 and PowerShell 3.0 version 2.0 doesn't want to work with cmdlets built with 4.0.

Okay, I need to upgrade my Windows 8 Consumer Preview workstation, where I build, to Release Preview, and build further on this host.

Jun 13, 2012 at 2:45 PM
Edited Jun 13, 2012 at 3:30 PM

Nice, thanks for the prompt response. Unfortunately the .NET 4 build still won't ipmo for me in win8 release preview, same error. Trying the 3.5 bits using -version 2.0 doesn't help either. (I do have .NET 3.5 enabled as a windows feature) In fact, running powershell -version 2.0 in win8 release preview doesn't behave the way I'd expected:

 

PS C:\WINDOWS\system32> powershell -version 2.0
Windows PowerShell
Copyright (C) 2012 Microsoft Corporation. All rights reserved.

PS C:\WINDOWS\system32> $psversiontable

Name                           Value
----                           -----
PSVersion                      3.0
WSManStackVersion              3.0
SerializationVersion           1.1.0.1
CLRVersion                     4.0.30319.17626
BuildVersion                   6.2.8400.0
PSCompatibleVersions           {1.0, 2.0, 3.0}
PSRemotingProtocolVersion      2.2

 

I was however able to ipmo the module from PoshConsole (http://poshconsole.codeplex.com/), so that's unblocked me for now, but it seems something must have changed between consumer preview and release preview. I'll stay tuned.

Coordinator
Jun 13, 2012 at 4:07 PM

I have uploaded the 0.7.8 that is built on Windows 8 Consumer Preview and tested on Windows 8 Release Preview (and 3.5 on 7 also).

I'll be cleaning up the disk space on my main Windows 8 host to upgrade it to 8 Release Preview (the upgrade process required mere 20(!) gigabytes of space as if this is a new installation :) I'm running this Windows 8 on 64GB SSD and such generosity is beyond my usual intents... :)