#requires -Version 7.0
param([string]$Root, [ValidateSet('Debug','Release')][string]$Configuration = 'Release')
$ErrorActionPreference = 'Stop'
$taskRoot = [IO.Path]::GetFullPath((Join-Path $PSScriptRoot '..'))
if (-not $Root) { $Root = Join-Path $taskRoot 'Server/runtime' }
$exe = Join-Path $taskRoot "Admin/XFEWarframe.Admin/bin/$Configuration/net10.0-windows10.0.22621.0/win-x64/XFEWarframe.Admin.exe"
foreach ($project in @('Server/XFEWarframe.Server/XFEWarframe.Server.csproj','Admin/XFEWarframe.Admin/XFEWarframe.Admin.csproj')) {
dotnet build (Join-Path $taskRoot $project) -c $Configuration --nologo -v quiet
if ($LASTEXITCODE -ne 0) { throw 'Build failed; old binaries will not be started.' }
}
$start = [Diagnostics.ProcessStartInfo]::new($exe)
$start.WorkingDirectory = $taskRoot
$start.UseShellExecute = $false
$start.ArgumentList.Add("--root=$([IO.Path]::GetFullPath($Root))")
[Diagnostics.Process]::Start($start) | Out-Null
#requires -Version 7.0
param([string]$Root, [ValidateSet('Debug','Release')][string]$Configuration = 'Release')
$ErrorActionPreference = 'Stop'
$taskRoot = [IO.Path]::GetFullPath((Join-Path $PSScriptRoot '..'))
if (-not $Root) { $Root = Join-Path $taskRoot 'Server/runtime' }
$exe = Join-Path $taskRoot "Admin/XFEWarframe.Admin/bin/$Configuration/net10.0-windows10.0.22621.0/win-x64/XFEWarframe.Admin.exe"
foreach ($project in @('Server/XFEWarframe.Server/XFEWarframe.Server.csproj','Admin/XFEWarframe.Admin/XFEWarframe.Admin.csproj')) {
dotnet build (Join-Path $taskRoot $project) -c $Configuration --nologo -v quiet
if ($LASTEXITCODE -ne 0) { throw 'Build failed; old binaries will not be started.' }
}
$start = [Diagnostics.ProcessStartInfo]::new($exe)
$start.WorkingDirectory = $taskRoot
$start.UseShellExecute = $false
$start.ArgumentList.Add("--root=$([IO.Path]::GetFullPath($Root))")
[Diagnostics.Process]::Start($start) | Out-Null