Skip to content

Provider-specific help cannot be loaded from MAML XML files because of incorrect XPath query #2088

@0xfeeddeadbeef

Description

@0xfeeddeadbeef

Steps to reproduce

Run Update-Help before trying to reproduce this issue.

When you navigate to Cert:\ drive and run Get-Help New-Item -Full command, you might expect to see same text as on this page: New-Item for Certificate, but instead a generic version is displayed: New-Item.

Expected behavior

Provider-specific context-sensitive help text must be loaded from "$PSHOME\$($Host.CurrentUICulture)\Microsoft.PowerShell.Security.dll-help.xml" file and displayed to user.

Actual behavior

CertificateProvider.GetHelpMaml method fails to load snippet from XML help file because XPath expression is not quite valid:

/helpItems/providerHelp/CmdletHelpPaths/CmdletHelpPath{0}/command:command[command:details/command:verb='{1}' and command:details/command:noun='{2}']

All MAML XML files have declared the default namespace "http://msh" in root element, but it is not reflected neither in this XPath, nor in any implementations of ICmdletProviderSupportsHelp interface.

This bug can be found in all implementations of ICmdletProviderSupportsHelp interface:
WSManConfigProvider, FileSystemProvider and CertificateProvider.

Environment data

Can be reproduced using both released Windows PowerShell 5.0:

> $PSVersionTable
Name                           Value
----                           -----
PSVersion                      5.0.10586.117
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.10586.117
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

and built from sources, CoreCLR PowerShell 6.0:

> $PSVersionTable
Name                           Value
----                           -----
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
GitCommitId                    v6.0.0-alpha.9-139-ge4f3f8fd698a4ab31e2b856bd20f7b5aa23e068e-dirty
PSVersion                      6.0.0-alpha
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
SerializationVersion           1.1.0.1
PSEdition                      Core
CLRVersion
BuildVersion                   3.0.0.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-BugIssue has been identified as a bug in the productWG-Interactive-HelpSystemhelp infrastructure and formatting of help

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions