Is there an advanced Show-Command?

This topic contains 4 replies, has 4 voices, and was last updated by Profile photo of Hans O. Martinsen Hans O. Martinsen 2 years, 6 months ago.

  • Author
    Posts
  • #15903
    Profile photo of Hans O. Martinsen
    Hans O. Martinsen
    Participant

    Hi. Does anybody known if there already is any thoughts on making an advanced "Show-Command" as a quick way to do UI for your "Advanced Function".

    Two things I feel that Show-Command is lacking today is:
    – Parameter validation
    – Parameter help
    Both which is possible with an Advanced Function.

    Anyone with the same idea?
    Anyone who have done work like this?
    Anyone who have good reasons not to build something like this?
    Anyone who would like to create something like this? 🙂

    Kind Regards
    HansO

  • #15905
    Profile photo of Dave Wyatt
    Dave Wyatt
    Moderator

    Both of those things should basically be answered by running Get-Help on a command. (If there's parameter validation happening, the preconditions for that parameter should also be documented in the help.) It's probably possible to write a version of Show-Command which makes this information available somewhere, but you'd have to decide where to put it all. There's not a lot of room in that window for things like multi-line ValidateScript blocks.

  • #15907
    Profile photo of Daniel Krebs
    Daniel Krebs
    Participant

    I agree Show-Command lacks in terms of inline help for parameters. I think the Microsoft PowerShell team needs to improve the Show-Command window. Probably the best way to get this kind of improvement into one of the next versions of PowerShell would be to submit a suggestion on Connect and get votes.

    http://connect.microsoft.com/powerShell

    Would you be able to post a suggestion on Connect and advertise on Twitter, Facebook, etc. to get votes?

  • #15909
    Profile photo of Istvan Szarka
    Istvan Szarka
    Participant

    Individual parameters are always explained in the cmdlet's help file.
    Just type

    help Get-Process -ShowWindow

    or

    help Get-Process -Parameter *

  • #15950
    Profile photo of Hans O. Martinsen
    Hans O. Martinsen
    Participant

    Thank you all for kind and prompt answers. However, I understand that I have not expressed my thoughts explicitly enough.

    What I am proposing is a cmdlet that works like Show-Command, but is used as a simple way to get a GUI for your advanced function.

    There are some ways to do UIs like Sapien PowerShell Studio and ShowUI, but they are too much work fore something simple. That is why I thought of a cmdlet that would take all the nice metadata from your advanced function and build a GUI based upon that. Show-Command does some of this already, but for example it does not use the validate metadata to validate your input before you submit, nor does it give _inline_ help for each parameter.

    Does such a suggestion make sense? I could of course put the question to Connect, but newer versions of PS might not get ported back to Win 7, which is predominant now. And I would like to see something like this long before any such development would be mainstream. 🙂

    Any ideas?

You must be logged in to reply to this topic.