Last active
December 29, 2015 13:59
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -------------------------------------------------------------------- | |
# 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