From 1268b76dcd958886a9522eceec213309e6926396 Mon Sep 17 00:00:00 2001 From: Sergei Vorobev Date: Wed, 3 Feb 2016 17:25:51 -0800 Subject: [PATCH] Teach PowerShellGithubDev.psm1 -NoNewWindow Mode We need it to run tests in CI --- PowerShellGithubDev.psm1 | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/PowerShellGithubDev.psm1 b/PowerShellGithubDev.psm1 index 7d9f0a58a..0e8bf5508 100644 --- a/PowerShellGithubDev.psm1 +++ b/PowerShellGithubDev.psm1 @@ -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 {