AlanTsai
9/7/2015 - 2:14 AM

Get iis website log location using powershell 快速取得某一個iis 站台的log位置 From http://stackoverflow.com/questions/6426375/where-can-i-find-the-iis-l

Get iis website log location using powershell 快速取得某一個iis 站台的log位置 From http://stackoverflow.com/questions/6426375/where-can-i-find-the-iis-logs #powershell

# 把{yoursite}換成iis站台名稱

# 把log位置顯示在 powershell
Get-Website {yoursite} | % { Join-Path ($_.logFile.Directory -replace '%SystemDrive%', $env:SystemDrive) "W3SVC$($_.id)" }

# 用explorer開啟log資料夾
Get-Website {yoursite} | % { Join-Path ($_.logFile.Directory -replace '%SystemDrive%', $env:SystemDrive) "W3SVC$($_.id)" } | ii