Skip to content

Instantly share code, notes, and snippets.

@smartmeter
Forked from yurifedoseev/sites.cleanup
Created November 18, 2015 21:09
Show Gist options
  • Save smartmeter/8243e8bccfe425652e63 to your computer and use it in GitHub Desktop.
Save smartmeter/8243e8bccfe425652e63 to your computer and use it in GitHub Desktop.
Delete all sites from IIS express configuration
appcmd.exe list site /xml | appcmd delete site /in
@smartmeter
Copy link
Author

list site /xml | appcmd delete site /in
//or

$appCmd = "C:\Program Files (x86)\IIS Express\appcmd.exe"

$result = Invoke-Command -Command {& $appCmd 'list' 'sites' '/text:SITE.NAME' }; for ($i=0; $i -lt $result.length; $i++) { Invoke-Command -Command {& $appCmd 'delete' 'site' $result[$i] }}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment