3

I am working on providers and cmdlets for Powershell 1 & 2.

Which version(s) of the framework should I target for my extensions?

I assume Microsoft.NET 2 will work fine. What about 3.0 and 3.5? Microsoft.NET 4.0?

Peter Stephens
  • 1,040
  • 1
  • 9
  • 23

1 Answers1

5

It demands 2.0, but .NET 3.0 and 3.5 still share the CLI version, so if 2.0 works, 3.0 and 3.5 should be fine if the machine has them installed; there are lots of examples of, for example, WCF (3.0) with powershell. Harder to tell on 4.0 since it isn't RTM.

Marc Gravell
  • 1,026,079
  • 266
  • 2,566
  • 2,900
  • That's kind of what I thought. Powershell seemed to behave this way. I just couldn't find any documentation on it. Thanks! – Peter Stephens Jul 26 '09 at 00:30
  • .NET 4 assemblies won't work in PowerShell 2 by default. But you can force PowerShell to use the .NET 4 CLR. See http://stackoverflow.com/questions/2094694/how-can-i-run-powershell-with-the-net-4-runtime for number of examples. I've successfully used the COMPLUS activation method referenced here https://gist.github.com/882528 and prefer it because it only turns on .NET 4 CLR for the specific scripts I want to run. – Peter Stephens Oct 04 '11 at 21:17