5

我知道您可以使用 PowerShell 将注册表之类的东西变成驱动器号。PowerShell 中还有其他对象以这种方式对待其他对象。有谁知道以这种方式访问​​ IIS 日志的任何 cmdlet?

4

1 回答 1

1

快速而肮脏的脚本会起作用吗?W3c日志文件头的第三行(IIS默认保存)有#Header行...另存为Import-W3CLog.ps1

param ($logfile)
import-csv -Delimiter " " -Header "date","time","s-ip","cs-method","cs-uri-stem","cs-uri-query","s-port","cs-username","c-ip","csUser-Agent","sc-status","sc-substatus","sc-win32-status","time-taken" -path $logfile | where { !($_.Date.StartsWith('#')) }
于 2011-02-18T18:06:48.600 回答