Skip to content

Commit c5438f6

Browse files
committed
Redirect standard streams for Start-UnityEditor
1 parent 43386b8 commit c5438f6

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
@@ -777,12 +777,18 @@ function Start-UnityEditor {
777777
# clone the shared args list
778778
$unityArgs = $sharedArgs | ForEach-Object { $_ }
779779
if ( $instanceArgs[$i] ) { $unityArgs += $instanceArgs[$i] }
780+
780781
$setProcessArgs = @{
781782
'FilePath' = $editor;
782783
'PassThru' = $true;
783784
'ErrorAction' = 'Stop';
785+
'RedirectStandardOutput' = New-TemporaryFile;
786+
'RedirectStandardError' = New-TemporaryFile;
784787
}
785788

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

0 commit comments

Comments
 (0)