User1331732461 posted
Hi,
You have created a pool and assign the object to a specific powershell variable.
Even though you have changed any attribute of the variable, that does not affect the actual apppool object and that is currenly by design. And that can be solved with using Set-ItemProperty as the following:
$name = "test3"
$pool = New-WebAppPool -Name $name
$pool.recycling.periodicrestart.time = [TimeSpan]::FromMinutes(0)
$pool.processModel.idleTimeout = [TimeSpan]::FromMinutes(0)
Set-ItemProperty ("IIS:\AppPools\"+$name) -Name recycling.periodicrestart.time $pool.recycling.periodicrestart.time
Set-ItemProperty ("IIS:\AppPools\"+$name) -Name processModel.idleTimeout $pool.processModel.idleTimeout
Get-ItemProperty ("IIS:\AppPools\"+$name) -Name recycling.periodicrestart.time.value
Get-ItemProperty ("IIS:\AppPools\"+$name) -Name processModel.idleTimeout.value
If you run the above commands, you will see there is a new apppool named "test3" and the periodicrestart and the idletimeout of the apppool is set to 0.