Skip to content

Instantly share code, notes, and snippets.

@rodolfofadino
Last active December 29, 2015 13:59
Show Gist options
  • Save rodolfofadino/7681332 to your computer and use it in GitHub Desktop.
Save rodolfofadino/7681332 to your computer and use it in GitHub Desktop.
Configure iis Uso: set-executionpolicy remotesigned ((new-object net.webclient).DownloadFile("https://gist.github.com/rodolfofadino/7681332/raw/configureiis","configureiis.ps1")) .\configureiis.ps1
# --------------------------------------------------------------------
# Checking Execution Policy
# --------------------------------------------------------------------
#$Policy = "Unrestricted"
$Policy = "RemoteSigned"
If ((get-ExecutionPolicy) -ne $Policy) {
Write-Host "Script Execution is disabled. Enabling it now"
Set-ExecutionPolicy $Policy -Force
Write-Host "Please Re-Run this script in a new powershell enviroment"
Exit
}
# --------------------------------------------------------------------
# Installing IIS
# --------------------------------------------------------------------
Install-WindowsFeature -Name Web-Common-Http,Web-Asp-Net,Web-Net-Ext,Web-ISAPI-Ext,Web-ISAPI-Filter,Web-Http-Logging,Web-Request-Monitor,Web-Basic-Auth,Web-Windows-Auth,Web-Filtering,Web-Performance,Web-Mgmt-Console,Web-Mgmt-Compat,WAS -IncludeAllSubFeature
# --------------------------------------------------------------------
# Loading IIS Modules
# --------------------------------------------------------------------
Import-Module WebAdministration
# --------------------------------------------------------------------
# Resetting IIS
# --------------------------------------------------------------------
$Command = "IISRESET"
Invoke-Expression -Command $Command
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment