Skip to content

Instantly share code, notes, and snippets.

@rbirkby
Created February 3, 2014 15:48
Show Gist options
  • Save rbirkby/8786337 to your computer and use it in GitHub Desktop.
Save rbirkby/8786337 to your computer and use it in GitHub Desktop.
Gets the physical directory of an IIS website into a DOS batchfile variable using PowerShell
powershell -command "ipmo WebAdministration; (gi $(gi 'iis:\Sites\Default Web Site\VDIR').physicalpath).parent.fullname | write-host" > destinationtmp.txt
SET /p DESTINATION=<destinationtmp.txt
del destinationtmp.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment