#Install IIS,. NETFramework 3.5import-Module Servermanagerget-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-Windowsfeatureadd-windowsfeature Net-framework,was-includeallsubfeature#New Wwwroot DirectoryCmd/c"MD D:\wwwroot"#Delete the default siteimport-Module Webadministrationremove-website-name"Default Web Site"#change IISLog position to D:\IISLogCmd/c"MD D:\IISlog"$iislogdir="D:\IISLog"Set-webconfigurationproperty"/system.applicationhost/sites/sitedefaults"-name Logfile.directory-value$iislogdir
IIS configuration (Install IIS,. Net, change IIS log directory location)