Skip to content

HelpMessage parameter attribute does not dispay inside VSCode terminal #836

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
anwather opened this issue Jun 7, 2017 · 6 comments
Closed
Labels
Area-Extension Terminal Issue-Enhancement A feature request (enhancement).

Comments

@anwather
Copy link
Contributor

anwather commented Jun 7, 2017

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

[email protected]
[email protected]
[email protected]
[email protected]

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:
@anwather
Copy link
Contributor Author

anwather commented Jun 7, 2017

ParameterHelp.txt

@anwather anwather closed this as completed Jun 7, 2017
@anwather anwather reopened this Jun 7, 2017
@pcgeek86
Copy link
Contributor

pcgeek86 commented Jun 7, 2017

@anwather This message has some serious formatting issues. Can you please fix up the Markdown?

I was able to reproduce the same behavior, where you're not prompted to use !? for parameter help.

Would need @rkeithhill to weigh in on why the Integrated Terminal doesn't behave the same way as PowerShell Console Host. Is this something to do with a "mode" that the PowerShell engine is launch in, in VSCode?

@daviwil
Copy link
Contributor

daviwil commented Jun 7, 2017

Fixed the formatting. Thanks for pointing this out @anwather! Looks like this is an inconsistency in our host implementation, I'll get that fixed.

@daviwil daviwil added Area-Extension Terminal Issue-Enhancement A feature request (enhancement). labels Jun 7, 2017
@daviwil daviwil added this to the July 2017 milestone Jun 7, 2017
@daviwil daviwil modified the milestones: July 2017, Future Oct 26, 2017
@fbtibo
Copy link

fbtibo commented Dec 29, 2018

A year and a half later, and many many version later, I have the same issue here where HelpMessage work in PowerShell ISE but does'nt have effect when run from vscode with powershell extension

Shall I go back to powershell ISE to learn powershell? Is there a buggy version of powershell especially made just for vscode?

@rjmholt
Copy link
Contributor

rjmholt commented 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 #535

@SydneyhSmith
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Extension Terminal Issue-Enhancement A feature request (enhancement).
Projects
None yet
Development

No branches or pull requests

6 participants