Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Get-Help doesn't work if code contains 🔧 #26068

@sba923

Description

@sba923

Prerequisites

Steps to reproduce

GitHub Copilot has produced the following code:

Write-Host "🔧 Generating version.h at $versionHeaderPath"

with that code in a .ps1 file, Get-Help fails:

Get-Help : Get-Help could not find .\generate_version.ps1 in a help file in this session. To download updated help topics type: "Update-Help". To get help online, search for the help  
topic in the TechNet library at https:/go.microsoft.com/fwlink/?LinkID=107116.
At line:55 char:5
+     Get-Help @PSBoundParameters | more
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ResourceUnavailable: (:) [Get-Help], HelpNotFoundException
    + FullyQualifiedErrorId : HelpNotFound,Microsoft.PowerShell.Commands.GetHelpCommand

Removing that character fixes the issue.

Here's such an offending file:

generate_version.zip

Expected behavior

NAME
    C:\Development\ST\PVPAccessory\generate_version.ps1

SYNOPSIS
    Generates version.h based on git tags and commit info.


SYNTAX
    C:\Development\ST\PVPAccessory\generate_version.ps1 [<CommonParameters>]


DESCRIPTION
    This script creates a version header file for the firmware using git metadata.


RELATED LINKS

REMARKS
    To see the examples, type: "get-help C:\Development\ST\PVPAccessory\generate_version.ps1 -examples".
    For more information, type: "get-help C:\Development\ST\PVPAccessory\generate_version.ps1 -detailed".
    For technical information, type: "get-help C:\Development\ST\PVPAccessory\generate_version.ps1 -full".



-- More  --

Actual behavior

Get-Help : Get-Help could not find .\generate_version.ps1 in a help file in this session. To download updated help topics type: "Update-Help". To get help online, search for the help  
topic in the TechNet library at https:/go.microsoft.com/fwlink/?LinkID=107116.
At line:55 char:5
+     Get-Help @PSBoundParameters | more
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ResourceUnavailable: (:) [Get-Help], HelpNotFoundException
    + FullyQualifiedErrorId : HelpNotFound,Microsoft.PowerShell.Commands.GetHelpCommand

Error details

Environment data

î‚´

Name                           Value
----                           -----
PSVersion                      7.5.3
PSEdition                      Core
GitCommitId                    7.5.3
OS                             Microsoft Windows 10.0.19045
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visuals

No response

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