Teach PowerShellGithubDev.psm1 -NoNewWindow Mode

We need it to run tests in CI
This commit is contained in:
Sergei Vorobev 2016-02-03 17:25:51 -08:00
parent a3c149196c
commit 1268b76dcd

View file

@ -4,14 +4,15 @@ function Start-DevPSGithub
[switch]$ZapDisable,
[string[]]$ArgumentList = '',
[switch]$LoadProfile,
[string]$binDir = "$PSScriptRoot\binFull"
[string]$binDir = "$PSScriptRoot\binFull",
[switch]$NoNewWindow
)
try
{
if ($LoadProfile -eq $false)
{
$ArgumentList += '-noprofile'
$ArgumentList = @('-noprofile') + $ArgumentList
}
$env:DEVPATH = $binDir
@ -32,8 +33,16 @@ function Start-DevPSGithub
"@
$configContents | Out-File -Encoding Ascii $binDir\powershell.exe.config
}
Start-Process -FilePath $binDir\powershell.exe -ArgumentList "$ArgumentList"
# splatting for the win
$startProcessArgs = @{
FilePath = "$binDir\powershell.exe"
ArgumentList = "$ArgumentList"
NoNewWindow = $NoNewWindow
Wait = $NoNewWindow
}
Start-Process @startProcessArgs
}
finally
{