我的本地计算机 Windows 10 Enterprise 中有 80 个应用程序池。Powershell ISE 中的 Get-IISAppPool 返回 80 个池。Visual Studio Code 中的 Get-IISAppPool 仅返回 5 个池。回收 IIS 不会改变结果。
$pools = Get-IISAppPool
"pools.Count: " + $pools.Count
pools.Count: 5
但是,在 VSCode 的 Powershell Integrated Shell 中,PS IIS:\AppPools> dir 返回 80 个应用程序池
编辑:从 VSCode 以不同的方式完成,返回预期的 80。
$pools = Get-ChildItem -Path "IIS:\AppPools"
"pools.Count: " + $pools.Count
pools.Count: 80
我在https://docs.microsoft.com/en-us/powershell/module/iisadministration/get-iisapppool?view=win10-ps上没有看到任何内容,表明我应该何时收到部分结果集,所以在哪个方向我应该排除故障吗?