#安装IIS、.NetFramework 3.5 Import-Module servermanager Get-WindowsFeature web-* | ? {$_.Name -ne "Web-WHC" -and $_.Name -ne "Web-Ftp-Server" -and $_.Name -ne "Web-Ftp-Ext" -and $_.Name -ne "Web-Ftp-Service" -and $_.Name -ne "Web-Custom-Logging" -and $_.Name -ne "Web-ODBC-Logging" -and $_.Name -ne "Web-Client-Auth" -and $_.Name -ne "Web-Cert-Auth" -and $_.Name -ne "Web-DAV-Publishing"} | Add-WindowsFeature Add-WindowsFeature NET-Framework,WAS -IncludeAllSubFeature #新建wwwroot目录 cmd /c "md D:\wwwroot" #删除默认站点 Import-Module webadministration Remove-Website -Name "Default Web Site" #更改IISLog位置到 D:\IISLog cmd /c "md D:\IISlog" $iislogdir = "D:\IISLog" Set-WebConfigurationProperty "/system.applicationHost/sites/siteDefaults" -name logfile.directory -value $iislogdir
时间: 2024-10-04 17:39:44