Open Source Web Application Framework for ASP.NET Core
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

32 lines
824 B

$scriptRoot = Split-Path -Parent $MyInvocation.MyCommand.Path
$jobs = @()
$jobs += Start-Job -Name "DbMigrator" -ScriptBlock {
$ErrorActionPreference = "Stop"
Set-Location (Join-Path $using:scriptRoot "../../src/Bench.DbMigrator")
dotnet run
if ($LASTEXITCODE -ne 0) {
throw "dotnet run (DbMigrator) exited with code $LASTEXITCODE"
}
}
Wait-Job $jobs | Out-Null
# Native tools can write warnings to stderr; keep them visible without failing completed jobs.
$jobs | Receive-Job -ErrorAction Continue
$failed = $jobs | Where-Object { $_.State -eq 'Failed' }
$hasError = $failed.Count -gt 0
if ($hasError) {
foreach ($job in $failed) {
[Console]::Error.WriteLine("Job '$($job.Name)' FAILED")
}
Remove-Job $jobs | Out-Null
exit -1
}
Remove-Job $jobs | Out-Null
exit 0