question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

HelpMessage parameter attribute does not dispay inside VSCode terminal

See original GitHub issue

System Details

  • Operating system name and version: Windows 10 1703

Copy / paste the below commands into the PowerShell Integrated Terminal, and paste the output here

C:\source\My-Scripts> code -v

1.12.2
19222cdc84ce72202478ba1cec5cb557b71163de
PS C:\source\My-Scripts> $pseditor.EditorServicesVersion


Major  Minor  Build  Revision
-----  -----  -----  --------
1      2      1      0


PS C:\source\My-Scripts> code --list-extensions --show-versions

donjayamanne.githistory@0.2.0
kube.theme-kay@0.2.0
ms-vscode.PowerShell@1.2.1
retrotheme.theme-retro@0.1.0

Issue Description

When using the helpmessage parameter attribute - if I call the function in the terminal without a mandatory parameter the helpmessage cannot be displayed.

Function Demo-Help  {
 [CmdletBinding()]
    Param(
        [Parameter(Mandatory=$true,HelpMessage="Enter a string for computer name",Position=0)]
        [string]$ComputerName
    )
}

From the terminal:

PS C:\source\My-Scripts> Demo-Help

cmdlet Demo-Help at command pipeline position 1
Supply values for the following parameters:
ComputerName:

From the PowerShell CLI or ISE:

C:\source\My-Scripts [master ≡ +2 ~1 -0 !]> demo-help

cmdlet Demo-Help at command pipeline position 1
Supply values for the following parameters:
(Type !? for Help.)
ComputerName:

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
SydneyhSmithcommented, Mar 27, 2019

Closing as PSReadLine is now available in the PowerShell Preview extension, tracking that PSReadLine is not available in the main PowerShell Extension here #1793

0reactions
rjmholtcommented, Jan 8, 2019

Is there a buggy version of powershell especially made just for vscode?

This feature doesn’t come from PowerShell, it comes from PSReadLine.

We have an issue tracking integration of PSReadLine in https://github.com/PowerShell/vscode-powershell/issues/535

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using HelpMessage in Parameter Attributes - TechNet
I am attempting to use the HelpMessage attribute for my PowerShell parameters, however, when I am prompted for the parameters while running ...
Read more >
Integrated Terminal in Visual Studio Code
Visual Studio Code has an integrated terminal to enable working in your shell of choice without leaving the editor.
Read more >
How can I use PowerShell with the Visual Studio Command ...
bat file, which is located in the Common7\Tools folder. pushd 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools' cmd /c "vsvars32 ...
Read more >
Page 5 - Arcane Code
We won't do much with it in this demo, but I've included it to show there are a variety of attributes you can...
Read more >
bin/magento (Magento Open Source) | Adobe Commerce
Omit the parameter if a directory is specified. Default: false; Does not accept a value. --help , -h. Display this help message.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found