Get-IISAppPool Doesn't Use Latest Information
I believe I found a bug in the Get-IISAppPool PowerShell cmdlet.
Create a script with the following:
* Check if an application pool exists using:
Get-IISAppPool -Name "Something"
Where "Something" indicates an application pool name.
* If the application pool exists, display some text.
* Otherwise, create the application pool.
1) Open a PowerShell window (as administrator) and run the script.
2) The application pool does not exist and is created (correct).
3) Do not close the window and run the script again.
4) The script again indicates that the application pool does not exist and tries to create it again (wrong).
It appears that Get-IISAppPool is caching the information and not properly refreshing with the latest information.
Mantas Marma commented
I wanted to say that I can't believe this is not solved yet, but who am I kidding...