setup_iis.ps1 938 B

12345678910111213141516171819
  1. param($action)
  2. $wwwroot = "C:\FrameworkBenchmarks\aspnet\www"
  3. $source = "C:\FrameworkBenchmarks\aspnet\src"
  4. # Stop
  5. if (Get-WebSite -Name Benchmarks) { Remove-WebSite -Name Benchmarks }
  6. Get-ChildItem -Path $wwwroot -Recurse -ErrorAction 'SilentlyContinue' | Remove-Item -Force -Recurse -ErrorAction 'SilentlyContinue';
  7. Remove-Item -Force -Recurse $wwwroot -ErrorAction 'SilentlyContinue'
  8. if ($action -eq 'start') {
  9. # Create a website in IIS
  10. New-Item -Path $wwwroot -Type directory | Out-Null
  11. New-WebSite -Name Benchmarks -Port 8080 -PhysicalPath $wwwroot
  12. # Build the project
  13. C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe "$source\Benchmarks.AspNet.csproj" /p:Configuration=Release /p:Platform="x64" /t:Clean
  14. C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe "$source\Benchmarks.AspNet.csproj" /p:Configuration=Release /p:Platform="x64" /p:DeployOnBuild=true /p:PublishProfile=IIS
  15. }