File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed
src/System.Management.Automation/engine Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -4788,21 +4788,23 @@ internal static SessionStateAliasEntry[] BuiltInAliases
47884788 $moreCommand = (Get-Command -CommandType Application less | Select-Object -First 1).Definition
47894789 }
47904790
4791- $process = [System.Diagnostics.Process]::new();
4791+ $process = [System.Diagnostics.Process]::new()
47924792
4793- $process.StartInfo.FileName = 'C:\Windows\system32\more.com';
4794- $process.StartInfo.UseShellExecute = $false;
4795- $process.StartInfo.RedirectStandardInput = $true;
4793+ $process.StartInfo.FileName = 'C:\Windows\system32\more.com'
4794+ $process.StartInfo.UseShellExecute = $false
4795+ $process.StartInfo.RedirectStandardInput = $true
47964796
4797- $process.Start();
4797+ $null = $ process.Start()
47984798
4799- $streamWriter = $process.StandardInput;
4799+ $streamWriter = $process.StandardInput
48004800}
48014801
48024802Process
48034803{
4804- if ($Line) {
4804+ if ($Line -is [string] ) {
48054805 $streamWriter.WriteLine($Line)
4806+ } else {
4807+ $Line | Out-String | more
48064808 }
48074809}
48084810
@@ -4814,7 +4816,7 @@ internal static SessionStateAliasEntry[] BuiltInAliases
48144816 }
48154817 } else {
48164818 $streamWriter.Close()
4817- $process.WaitForExit();
4819+ $process.WaitForExit()
48184820 $process.Close()
48194821 }
48204822}
You can’t perform that action at this time.
0 commit comments