by poshoholic » Mon Oct 01, 2012 1:38 pm
Hi Jim,
Just thinking out loud, you could probably manage this with PowerShell. For example, have a command in your profile that creates the config file so that PowerShell launches with .NET 4 and then invoke PowerShell in a nested prompt to get v4 "on demand", removing or renaming that config file when you finish (i.e. when you return from the nested session). Another possibility would be to use different hosts, one for v2 work with .NET 2 and another for v2 work with .NET 4. For example, native PowerShell with .NET 2, and one of the third party free editors configured with .NET 4. Then you just need to pick the right environment for the job. I'm sure there are other possibilities as well via scripting. I haven't tried these myself, but the flexibility is there for you to achieve what you need.
Also, Matt, one reason someone might want to stick with .NET v2 is SharePoint. SharePoint 2010 PowerShell does not work with .NET 4 afaik.