Powershell 列出活动 HTTP 请求

Ken*_*n J 5 iis powershell

在Windows 2008中有APPCMD,可以这样使用:

appcmd list request
appcmd list request /apppool.name:DefaultAppPool
Run Code Online (Sandbox Code Playgroud)

有没有办法在 Powershell 中实现这一点?

Sea*_*one 6

有一种方法。

我使用以下内容:

Get-Website | where {$_.name -eq $webSite} | Get-WebRequest
Run Code Online (Sandbox Code Playgroud)

该变量$webSite只是网站名称,但Get-WebSite -Name "SiteName"似乎不起作用。

https://technet.microsoft.com/en-us/library/ee790581.aspx

  • 有些用途需要先运行“Import-Module WebAdministration”,然后再执行“Get-Website”等 IIS cmdlet。 (3认同)