How do I set the .NET Framework Version when using New-WebAppPool?

前端 未结 3 1686
长情又很酷
长情又很酷 2020-12-29 02:06

I\'m looking to see how I can use the IIS PowerShell Cmdlet New-WebAppPool to specify the version of the .NET Framework to use. Currently, it defaults to v

3条回答
  •  有刺的猬
    2020-12-29 02:51

    Alternatively, you can set this the on the return value from the New-WebAppPool cmdlet. This approach can be useful if you want to change other properties as well.

    For the v4.0 pool it'll look like this:

    Import-Module WebAdministration
    $appPool = New-WebAppPool -Name Pool1
    $appPool.managedRuntimeVersion = "v4.0"
    $appPool | Set-Item
    

    To set it to 'No managed code' you can use this:

    Import-Module WebAdministration
    $appPool = New-WebAppPool -Name Pool2
    $appPool.managedRuntimeVersion = ""
    $appPool | Set-Item
    

提交回复
热议问题