Skip to content

Commit

Permalink
Pass non-string objects through formatting system
Browse files Browse the repository at this point in the history
  • Loading branch information
iSazonov committed Jan 29, 2018
1 parent 87c24d8 commit 83f241d
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/System.Management.Automation/engine/InitialSessionState.cs
Expand Up @@ -4788,21 +4788,23 @@ internal static SessionStateAliasEntry[] BuiltInAliases
$moreCommand = (Get-Command -CommandType Application less | Select-Object -First 1).Definition
}
$process = [System.Diagnostics.Process]::new();
$process = [System.Diagnostics.Process]::new()
$process.StartInfo.FileName = 'C:\Windows\system32\more.com';
$process.StartInfo.UseShellExecute = $false;
$process.StartInfo.RedirectStandardInput = $true;
$process.StartInfo.FileName = 'C:\Windows\system32\more.com'
$process.StartInfo.UseShellExecute = $false
$process.StartInfo.RedirectStandardInput = $true
$process.Start();
$null = $process.Start()
$streamWriter = $process.StandardInput;
$streamWriter = $process.StandardInput
}
Process
{
if ($Line) {
if ($Line -is [string]) {
$streamWriter.WriteLine($Line)
} else {
$Line | Out-String | more
}
}
Expand All @@ -4814,7 +4816,7 @@ internal static SessionStateAliasEntry[] BuiltInAliases
}
} else {
$streamWriter.Close()
$process.WaitForExit();
$process.WaitForExit()
$process.Close()
}
}
Expand Down

0 comments on commit 83f241d

Please sign in to comment.