Skip to content

Dynamic Help - NullReferenceException in Powershell 7.2.0-preview.3 and Windows Powershell 5.1.19041.610 #2283

Closed
@carlocardella

Description

@carlocardella

Environment

PS version: 7.2.0-preview.3
PSReadline version: 2.2.0-beta2
os: 10.0.19041.1 (WinBuild.160101.0800)
PS file version: 7.2.0.0
HostName: ConsoleHost
BufferWidth: 157
BufferHeight: 9999
PS version: 5.1.19041.610
PSReadline version: 2.2.0-beta2
os: 10.0.19041.1 (WinBuild.160101.0800)
PS file version: 10.0.19041.1 (WinBuild.160101.0800)
HostName: ConsoleHost
BufferWidth: 155
BufferHeight: 9999

Exception report

Environment

PSReadLine: 2.2.0-beta2
PowerShell: 7.2.0-preview.3
OS: Microsoft Windows 10.0.19042
BufferWidth: 190
BufferHeight: 55

Last 1 Keys

 F1

Exception

System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.PowerShell.PSConsoleReadLine.DynamicHelpImpl(Boolean isFullHelp)
   at Microsoft.PowerShell.PSConsoleReadLine.ShowCommandHelp(Nullable`1 key, Object arg)
   at Microsoft.PowerShell.PSConsoleReadLine.ProcessOneKey(PSKeyInfo key, Dictionary`2 dispatchTable, Boolean ignoreIfNoAction, Object arg)
   at Microsoft.PowerShell.PSConsoleReadLine.InputLoop()
   at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics, CancellationToken cancellationToken)

Steps to reproduce

Open a fresh Powershell console and press F1.
Reproduces with no profile loaded (pwsh -noprofile) and no modules other than the latest PSReadLine

PS C:\Users\carloc> gmo

ModuleType Version    PreRelease Name                                ExportedCommands
---------- -------    ---------- ----                                ----------------
Script     2.2.0      beta2      PSReadLine                          {Get-PSReadLineKeyHandler, Get-PSReadLineOption, Remove-PSReadLineKeyHandler, Set-PSRe

Note: no error with PowerShell 7.1.2

Expected behavior

Actual behavior

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions