标签: powershell iis
Import-Module WebAdministration $LogPath = “D:\Logs\IIS” foreach($site in (dir iis:\sites\*)) { New-Item $LogPath\$($site.Name) -type directory Set-ItemProperty IIS:\Sites\$($site.Name) -name logFile.directory -value “$LogPath\$($site.Name)” }