function Set-AllAppPoolDefaults { <# .SYNOPSIS Sets all Application Pools to the Alkami Defaults #> [CmdletBinding()] Param() $logLead = (Get-LogLeadName) $appPoolsToCheck = (Get-ChildItem IIS:\AppPools\).Where({$_.Name -notlike ".NET *" -and $_.ManagedRuntimeVersion -eq "v4.0"}) Write-Verbose ("$logLead : Found {0} application pools to check" -f $appPoolsToCheck.Count) foreach ($appPool in $appPoolsToCheck) { (Set-AlkamiWebAppPoolConfiguration $appPool.Name) } $sites = (Get-ChildItem IIS:\Sites\) foreach ($site in $sites) { (Set-ItemProperty "IIS:\Sites\$($site.Name)" -Name applicationDefaults.preloadEnabled -Value $true) | Out-Null } }