|
- param(
- [string]$IisExpressPath = "$env:ProgramFiles\IIS Express\iisexpress.exe",
- [string]$ConfigPath = "$(Join-Path $PSScriptRoot 'applicationhost.config')",
- [string]$SiteName = "AspClassicPublicSite",
- [switch]$TraceErrors
- )
-
- & (Join-Path $PSScriptRoot 'build-iisexpress-config.ps1') -OutputPath $ConfigPath
- if ($LASTEXITCODE -ne 0) {
- exit $LASTEXITCODE
- }
-
- if (-not (Test-Path -LiteralPath $IisExpressPath)) {
- $IisExpressPath = "$env:ProgramFiles(x86)\IIS Express\iisexpress.exe"
- }
-
- if (-not (Test-Path -LiteralPath $IisExpressPath)) {
- Write-Error "IIS Express not found. Checked Program Files and Program Files (x86)."
- exit 1
- }
-
- $arguments = @("/config:$ConfigPath", "/site:$SiteName")
- if ($TraceErrors) {
- $arguments += "/trace:error"
- }
-
- Write-Host "Starting IIS Express site '$SiteName' using config '$ConfigPath'..."
- & $IisExpressPath @arguments
|