Powershell: Get-Help output doesn't format propely when aliases man or help is used

Created on 26 Apr 2018  路  17Comments  路  Source: PowerShell/PowerShell

When using Get-Help aliases man or help output for a cmdlet gives output properly formatted till PS 5.1, but 6.x misses that.

Steps to reproduce

man Invoke-Command

Expected behavior

image

Actual behavior

image

Environment data

> $PSVersionTable
Name                           Value
----                           -----
PSVersion                      6.1.0-preview.1
PSEdition                      Core
GitCommitId                    v6.1.0-preview.1
OS                             Microsoft Windows 10.0.10586
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0
Issue-Discussion Resolution-Answered WG-Interactive-HelpSystem

Most helpful comment

Is this still an issue? I wasn't able to reproduce on 7.1rc1.

All 17 comments

Thanks for your report! Could you please test with latest build?

@iSazonov Actually I'm facing some difficulty in building it locally,

image

Please download from https://github.com/PowerShell/PowerShell#get-powershell

@iSazonov , Thanks, buts its a repro in latest build too
image

Thanks! I can not repo with default console. What is your console config? Width?

IMO, it should responsive.

ForegroundColor       : Gray
BackgroundColor       : Black
CursorPosition        : 0,85
WindowPosition        : 0,69
CursorSize            : 25
BufferSize            : 237,9001
WindowSize            : 237,63
MaxWindowSize         : 237,63
MaxPhysicalWindowSize : 239,63
KeyAvailable          : True
WindowTitle           : Administrator: C:\Users\---\Downloads\PowerShell-6.1.0-preview.1-win-x64\pwsh.exe

Thanks! Could you tests with width < 120?

Sure, this is with 119

image

I can get the same only if I maximize console window, do Get-Help Invoke-Command, restore console windows. If I then get previous command the cursor set on top line :confused:

I'm not able to repro this either with various console sizes. Like @iSazonov I can only get "improper" formatting if I resize the console window after it's calculated the output which is expected.

Maybe a locale or font?

@iSazonov , @SteveL-MSFT I'm getting this with any window size, but only when I use aliases both man and help. Get-Help works fine. But the aliases works perfectly till 5.1. I have updated the title. I think I added Get-Help in mu first comment. Actually I was using man

This is very interesting.

This is "by design" in that when you just use Get-Help, it returns an ExtendedCmdletHelpInfo object which gets formatted. When you use help (or alias man) or even Get-Help | more, it's the raw text which is not formatted for your console.

@SteveL-MSFT Got it and I can see the output type diff, but alias _(definition: used to indicate that a named person is also known or more familiar under another specified name.)_ should be a kind of aka , but what I understood from this exercise is man and help does a |more to the output by default, is my understanding correct ?

yes, help (aka man) basically does get-help | more (where more itself is currently a function, but there's a whole other discussion on that)

Is this still an issue? I wasn't able to reproduce on 7.1rc1.

looks fine now. Thanks @ThomasNieto for checking this out.

Was this page helpful?
0 / 5 - 0 ratings