#Below is the script for Installing IIS
# save file to .PS1 and call from a batch file or in a PS script shell
<#
.SYNOPSIS
Script for installing IIS etc
.DESCRIPTION
#>
$PV = 0
# Install IIS
install-windowsfeature -name web-server -IncludeManagementTools -IncludeAllSubFeature -ErrorAction SilentlyContinue | out-null
if($? -eq $false) { $PV = 1 }
#Remove WebDAV Publishing
Remove-WindowsFeature Web-DAV-Publishing -ErrorAction SilentlyContinue | out-null
# Enable Hidden Files
. "$($env:windir)\System32\inetsrv\AppCmd" set config "Default Web Site/" /section:system.webServer/webdav/authoring /fileSystem.allowHiddenFiles:true /commit:apphost
# Install BITS
install-windowsfeature -name BITS -IncludeManagementTools -IncludeAllSubFeature -ErrorAction SilentlyContinue | out-null
if($? -eq $false) { $PV = 1 }
exit $PV