Created
August 7, 2014 08:47
-
-
Save lennybacon/120103adae98da084c32 to your computer and use it in GitHub Desktop.
IIS Configuration PowerShell Script
This file contains 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
Set-Alias iiscfg Edit-ApplicationHostsConfig | |
function Edit-ApplicationHostsConfig { | |
$file = Get-ApplicationHostsConfig | |
edit $file | |
} | |
function Get-ApplicationHostsConfig(){ | |
$appHostConfig = "C:\Windows\sysnative\inetsrv\config\applicationHost.config" | |
$exists = Test-Path $appHostConfig | |
if($exists -eq $false){ | |
$appHostConfig = "C:\Windows\system32\inetsrv\config\applicationHost.config" | |
} | |
$exists = Test-Path $appHostConfig | |
if($exists -eq $false){ | |
throw "The file applicationHost.config could not be found!" | |
} | |
return $appHostConfig | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment