anchor.diff:  goto :Done
   
   :Run
  -set cmd=%*
  -if EXIST %LogFile% del %LogFile% /f /q
  -call %cmd%>%LogFile%
  +set _cmd=%*
  +if EXIST %_logFile% del %_logFile% /f /q
  +call %_cmd%>%_logFile%
   exit /b
   
   :Failure
  -set ExitCode=1
  -if NOT '%cmd%'=='' (
  +set _exitCode=1
  +if NOT '%_cmd%'=='' (
       echo.
       echo Failed to run:
  -    echo %cmd%
  +    echo %_cmd%
   )
  -if EXIST %LogFile% type %LogFile%
  +if EXIST %_logFile% type %_logFile%
   
   :Done
  -exit /b %ExitCode%
  -endlocal+exit /b %_exitCode%
  +endlocal
  
positive.code: @echo off
  setlocal
  
  set Id=%1
  set IdMaster=Master
  set WcfTestDir=c:\WCFTest
  set RepoHome=c:\git
  set CurrentRepo=%RepoHome%\wcf%Id%
  set MasterRepo=%RepoHome%\wcf%IdMaster%
  set PRServiceName=PRService%Id%
  set WcfServiceName=WcfService%Id%
  set PRServiceMaster=PRService%IdMaster%
  set WcfServiceMaster=WcfService%IdMaster%
  set LogFile="%~dp0%~n0.log"
  set CertExpirationInDays=99
  set ExitCode=0
  set cmd=
  
  if '%1'=='' goto :Usage
  if '%1'=='/?' goto :Usage
  
negative.code: if '%1'=='/help' goto :Usage
  if '%1'=='-help' goto :Usage
  
  :: Make sure this script is running in elevated
  net session>nul
  if ERRORLEVEL 1 (
      echo Exiting... Please run this script with elevated permission.
      goto :Failure
  )
  
  :: Make sure IIS appcmd.exe is accessible
  set _appcmd=%windir%\System32\inetsrv\appcmd.exe
  if NOT EXIST %_appcmd% (
      echo Could not find: %_appcmd%.
      echo Please make sure IIS is installed.
      goto :Failure
  )
  
  :: Clean up any existing setup
  echo Deleting WCF repo at %_currentRepo% if exists and associated application pools and services hosted on IIS...
  %_appcmd% delete app "Default Web Site/%_prServiceName%" >nul
  %_appcmd% delete apppool %_prServiceName% >nul
  %_appcmd% delete app "Default Web Site/%_wcfServiceName%" >nul
  %_appcmd% delete apppool %_wcfServiceName% >nul
  if exist %_currentRepo% rmdir /s /q %_currentRepo%
  if exist %_wcfTestDir% if /I '%_masterRepo%'=='%_currentRepo%' rmdir /s /q %_wcfTestDir%
  echo Clean up done.
  if /I '%2'=='/c' goto :Done
  
  