Created
July 15, 2016 14:14
-
-
Save NearlyUnique/e1e466d5c9e2fb9320783387abffeed5 to your computer and use it in GitHub Desktop.
Adds the PUT and DELETE verbs to iis express (or vsual studio version)
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
param ( | |
[switch]$vs | |
) | |
$path = "$env:UserProfile\Documents\IISExpress\config\applicationhost.config" | |
if ($vs) { | |
if (!(test-path .vs)) { | |
"Not in solution directory! no '.vs' directory" | |
exit(1) | |
} | |
$path = "$pwd\.vs\config\applicationhost.config" | |
} | |
"Loading $path" | |
[xml]$config = Get-Content $path | |
$ext = ($config.configuration.location."system.webserver".handlers.add | ? {$_.name -eq "ExtensionlessUrl-Integrated-4.0"}) | |
"Found '$($ext.verb)'" | |
$verbs = $ext.verb.split(',') | |
if (-not $verbs.contains("PUT")) { | |
"Adding PUT" | |
$verbs += "PUT" | |
} | |
if (-not $verbs.contains("DELETE")) { | |
"Adding DELETE" | |
$verbs += "DELETE" | |
} | |
$ext.verb = ($verbs -join ',') | |
$config.save($path) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment