How can I run PowerShell with the .NET 4 runtime?

前端 未结 11 2367
走了就别回头了
走了就别回头了 2020-11-22 07:38

I am updating a PowerShell script that manages some .NET assemblies. The script was written for assemblies built against .NET 2 (the same version of the framework that Power

11条回答
  •  刺人心
    刺人心 (楼主)
    2020-11-22 08:03

    If you only need to execute a single command, script block, or script file in .NET 4, try using Activation Configuration Files from .NET 4 to start only a single instance of PowerShell using version 4 of the CLR.

    Full details:

    http://blog.codeassassin.com/2011/03/23/executing-individual-powershell-commands-using-net-4/

    An example PowerShell module:

    https://gist.github.com/882528

提交回复
热议问题