Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iis Powershell列出活动HTTP请求_Iis_Powershell - Fatal编程技术网

Iis Powershell列出活动HTTP请求

Iis Powershell列出活动HTTP请求,iis,powershell,Iis,Powershell,在Windows 2008中,有一个APPCMD,可以这样使用: appcmd list request appcmd list request /apppool.name:DefaultAppPool 有没有办法在Powershell中实现这一点?有办法 我使用以下方法: Get-Website | where {$_.name -eq $webSite} | Get-WebRequest 变量$webSite只是网站名称,但是获取网站名称“SiteName”似乎不起作用 您尝试获取Web

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

appcmd list request
appcmd list request /apppool.name:DefaultAppPool
有没有办法在Powershell中实现这一点?

有办法

我使用以下方法:

Get-Website | where {$_.name -eq $webSite} | Get-WebRequest
变量
$webSite
只是网站名称,但是
获取网站名称“SiteName”
似乎不起作用


您尝试获取WebRequest了吗?一些用户需要运行
导入模块WebAdministration
bevor执行IIS cmdlet,如
Get-Website
。我使用PowerShell Core(6.2.0)尝试了这一点,但不幸的是,许多IIS管理cmdlet还不存在,而且对
WebAdministration
模块没有支持,或者更高版本的
IISAdministration
模块。我试图在容器中运行此模块,需要先安装请求监视器Windows功能:
Enable windowoptionalfeature-Online-FeatureName IIS RequestMonitor