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
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