-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.ps1
More file actions
24 lines (22 loc) · 779 Bytes
/
Copy pathrun.ps1
File metadata and controls
24 lines (22 loc) · 779 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
$IISExpressPath = Join-Path $env:ProgramFiles "IIS Express\iisexpress.exe"
if (-not (Test-Path $IISExpressPath))
{
# Try x86 path
$IISExpressPath = Join-Path ${env:ProgramFiles(x86)} "IIS Express\iisexpress.exe"
if (-not (Test-Path $IISExpressPath))
{
throw "IIS Express not found. Please install IIS Express to run this test."
}
}
$SourcePath = "$PSScriptRoot\Main"
$PublishPath = "$PSScriptRoot\bin\_PublishedWebsites\Main"
$Url = ((Select-String applicationUrl $SourcePath\Properties\launchSettings.json).Line -split '"')[3]
$Port = [System.Uri]::New($Url).Port
Start-Process powershell -ArgumentList @(
"-NoProfile",
"-NoExit",
"-Command",
"& '$IISExpressPath' /path:$PublishPath /port:$Port"
)
Start-Sleep -Seconds 1
start $url