Interestingly, you see it as [Hashtable] . I see this as [Microsoft.Iis.Powershell.Framework.ConfigurationElement] .
It has a method called .UpdateCollection() that expects [PSObject[]] , so it searches for an array of objects.
The fact is that calling this method, whether it is a pool object returned from New-WebAppPool or from Get-Item IIS:\AppPools\ExistingPool , results in an error indicating that it is read-only.
I tried to replace the entire .Collection new arraist with timespan objects added to it, and I did not get any errors, but it did not set the value.
I also tried to create a ConfigurationElement object, but it does not seem to have a constructor, so it is probably a private class somewhere in the code.
I'm not saying that there is definitely no way to do this the way you want, but it seems to you that you are best off using Set-ItemProperty , as it seems that some of these attributes were designed to be updated only through the PS Provider.
source share