views:

65

answers:

2

I recently upgraded to VS 2010. Shortly after I noticed many powershell scripts I had written in the past no longer worked correctly. I am guessing that its because of .NET 4. Is there any way to fix this, or force powershell to use the older .NET?

Thanks for any help anyone can provide.

A: 

Did your VS2010, or another install, update your PowerShell environment to 2.0? Did you switch to a new OS (like Win7 or Server 2008 R2?)?

What sorts of errors are you seeing?

David Lively
I'm on Windows 7 64bit. As an example, I have a script that connects to a list of remote servers to check the McAfee version, and puts the results into an Excel spreadsheet. Before installing VS 2010 it worked fine. When I launch it from powershell not it just opens Excel and returns "True" on the command line. If I run it inside the ISE, it opens Excel and fills in the the first column with the server name (as it should) but that's it. It still works fine if I run it on a Windows 7 machine without VS 2010.
Brian
+1  A: 

Sounds like the Office Primary Interop Assemblies were updated as part of the VSTO (visual studio tools for office) portion in VS2010. Powershell will continue to use .NET 2.0 and the install of 4.0 should not affect it.

x0n