mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
fix help function to not pipe to more if objects are returned instead of help text (#5395)
This commit is contained in:
committed by
Aditya Patwardhan
parent
8b42e1748e
commit
e0ee555ad6
@@ -4258,10 +4258,20 @@ param(
|
||||
$PSBoundParameters['Full'] = $true
|
||||
}
|
||||
|
||||
#Set the outputencoding to Console::OutputEncoding. More.com doesn't work well with Unicode.
|
||||
# Set the outputencoding to Console::OutputEncoding. More.com doesn't work well with Unicode.
|
||||
$outputEncoding=[System.Console]::OutputEncoding
|
||||
|
||||
Get-Help @PSBoundParameters | more
|
||||
$help = Get-Help @PSBoundParameters
|
||||
|
||||
# If a list of help is returned, don't pipe to more
|
||||
if (($help | Select-Object -First 1).PSTypeNames -Contains 'HelpInfoShort')
|
||||
{
|
||||
$help
|
||||
}
|
||||
else
|
||||
{
|
||||
$help | more
|
||||
}
|
||||
";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user