PowerShell 2 running w/PowerShell 3: Import-module grouppolicy error

rated by 0 users
This post has 2 Replies | 2 Followers

Not Ranked
Posts 5
santonsen Posted: 04-24-2012 9:45 AM

When I try to import the gpo module I'm getting the error "Import-Module : Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information."

I'm running Windows 7x64 Enterprise, PowerShell 2/3, .Net 3.5/4, MS Visual C++ 2005/2008/2010.  I'm really not certain what params are need or how to pass the params to the PowerShell command.

Any help much appreciated.

Sheila

Top 10 Contributor
Posts 640

Well, don't try and use PowerShell v3 (which is a beta product) in production ;). You need to load the module into PowerShell v2. If you've installed v3 side-by-side with v2 (which it will do if v2 was already installed), from the Start menu run "powershell.exe -version 2.0" (without quotes) to launch the 2.0 engine. Then try your command again.

None of the currently available production modules from Microsoft are guaranteed to work in PowerShell v3. That's one reason v3 installs side-by-side with v2 - so that you can revert to 2.0 as needed for compatibility.

That particular module is telling you that you're running .NET 4 (which is what PowerShell v3 is built against), and it wants to run .NET 2 (which is present in .NET 3.51, and is what PowerShell v2 is built against). 

Not Ranked
Posts 5

Thank you! 

FYI - Works great for powershell.exe, but the -version isn't accepted in the ise

Page 1 of 1 (3 items) | RSS
Copyright 2012 PowerShell.com. All rights reserved.