Skip to content

Commit b72c4df

Browse files
authored
Merge pull request #90 from jwittner/fix/unityExitSpew
Redirect standard streams for Start-UnityEditor
2 parents 3138d7f + c5438f6 commit b72c4df

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

UnitySetup/UnitySetup.psm1

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -775,12 +775,18 @@ function Start-UnityEditor {
775775
# clone the shared args list
776776
$unityArgs = $sharedArgs | ForEach-Object { $_ }
777777
if ( $instanceArgs[$i] ) { $unityArgs += $instanceArgs[$i] }
778+
778779
$setProcessArgs = @{
779780
'FilePath' = $editor;
780781
'PassThru' = $true;
781782
'ErrorAction' = 'Stop';
783+
'RedirectStandardOutput' = New-TemporaryFile;
784+
'RedirectStandardError' = New-TemporaryFile;
782785
}
783786

787+
Write-Verbose "Redirecting standard output to $($setProcessArgs['RedirectStandardOutput'])"
788+
Write-Verbose "Redirecting standard error to $($setProcessArgs['RedirectStandardError'])"
789+
784790
if ($unityArgs -and $unityArgs.Length -gt 0) {
785791
$setProcessArgs['ArgumentList'] = $unityArgs
786792
}

0 commit comments

Comments
 (0)