Powershell: Get-Help does not display whole example body

Created on 13 Dec 2019  Â·  14Comments  Â·  Source: PowerShell/PowerShell

Steps to reproduce

(Get-Help Out-Null).Examples

Expected behavior

PowerShell 5.1

> (Get-Help Out-Null).Examples

------------------- Example 1: Delete output -------------------

PS C:\> Get-ChildItem | Out-Null

This command gets items in the current location/directory, but its output is not passed through the pipeline nor
displayed at the command line. This is useful for hiding output that you do not need.

Actual behavior

PowerShell 7.0

> (Get-Help Out-Null).Examples

------------------- Example 1: Delete output -------------------

Get-ChildItem | Out-Null

Environment data

Name                           Value
----                           -----
PSVersion                      7.0.0-preview.6
PSEdition                      Core
GitCommitId                    7.0.0-preview.6-59-gca202da6437f5c9ed334725469f6d8f1cb7e5a2c
OS                             Microsoft Windows 10.0.18363
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0
Issue-Bug Resolution-Fixed WG-Engine WG-Interactive-HelpSystem

Most helpful comment

The culprit is https://github.com/powershell/powershell/pull/11193
(Get-Help Out-Null).Examples works as expected until changes from this PR was merged in.

All 14 comments

I'm seeing this working properly. Can you try running Update-Help -ErrorAction SilentlyContinue and then check it again?

Tested on MacOS and windows, environment data below:

Name                           Value
----                           -----
PSVersion                      7.0.0-preview.6
PSEdition                      Core
GitCommitId                    7.0.0-preview.6
OS                             Microsoft Windows 10.0.18363
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0
Name                           Value
----                           -----
PSVersion                      7.0.0-preview.6
PSEdition                      Core
GitCommitId                    7.0.0-preview.6
OS                             Darwin 19.2.0 Darwin Kernel Version 19.2.0: Sat Nov  9 03:47:04 PST 2019; root:xnu-6153…
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Just did the help update but it changed nothing.

OK, found it. It works on PowerShell Preview-6 but not on the daily build.

@sdwheeler Could you please comment the issue?

I confirm it works in 7.0.0-preview.6.

@sdwheeler Why do this not work in daily build?

/cc @SteveL-MSFT have we changed anything relating to the help systems recently? Or does the issue originate somewhere else?

I only really work on the content side of the help. I don't know if or what changed in code.

Investigated this with @sdwheeler right now, seeing no repro on preview.6 and a definite repro on the nightly. We probably can't/shouldn't hold RC for a fix here, but it definitely needs to be fixed in RC....

Also checked HelpCommand.cs, nothing looks different there, so maybe this has to do with the formatting system? Or something @JamesWTruher et all may have done around VT100? Paging @adityapatwardhan as well

Possibly the recent fix with FirstOrDefault had an effect? /Cc @daxian-dbw

@vexx32 the regression is not caused by the FirstOrDefault fix. That fix is included in our internal rc.1 release branch, and (Get-Help Out-Null).Examples works as expected on the build produced from that branch

image

The culprit is https://github.com/powershell/powershell/pull/11193
(Get-Help Out-Null).Examples works as expected until changes from this PR was merged in.

@kborowinski Thanks for reporting the regression!

:tada:This issue was addressed in #11342, which has now been successfully released as v7.1.0-preview.1.:tada:

Handy links:

Was this page helpful?
0 / 5 - 0 ratings