0

I have 80 application pools in my local machine, Windows 10 Enterprise. Get-IISAppPool in Powershell ISE returns 80 pools. Get-IISAppPool in Visual Studio Code returns only 5 pools. Recycling IIS does not change the results.

$pools = Get-IISAppPool
"pools.Count: " + $pools.Count

pools.Count: 5

However, inside VSCode's Powershell Integrated Shell, PS IIS:\AppPools> dir returns the 80 application pools

Edit: From VSCode done a different way, returns the expected 80.

$pools = Get-ChildItem -Path "IIS:\AppPools"
"pools.Count: " + $pools.Count

pools.Count: 80

I'm not seeing anything on https://learn.microsoft.com/en-us/powershell/module/iisadministration/get-iisapppool?view=win10-ps indicating when I should receive a partial result set, so in which direction should I be troubleshooting?

disassemble-number-5
  • 955
  • 3
  • 11
  • 25
  • 1
    As it does not seem to be reproducible, you'd better open a support case via http://support.microsoft.com so that Microsoft guys might check your machine. – Lex Li Oct 21 '18 at 23:44
  • Just off chance - you aren't accidentally using PSRemote and connecting to another machine, thus giving you the diff # app pools? – Russell Oct 22 '18 at 00:39
  • @Russell correct. In fact the 5 pools returned are the first 5 pools returned of the 80. – disassemble-number-5 Oct 22 '18 at 11:24

1 Answers1

1

Repro'ed - The PowerShell Get-IISAppPool command does not update the list of returned Application Pools.

Get-IISAppPool returned the same list of application pools regardless of adding addition application pools via the IIS management console.

To work around this issue I started a new PowerShell CLI and Get-IISAppPool must have updated because it returned the correct list of results. HTH

bentcode
  • 11
  • 2
  • There's a similar solution here: [Odd issue when using Get-IISAppPool and creating a new app pool in the same session](https://stackoverflow.com/a/54660077/1144952) – Alex F Jul 12 '22 at 10:35