This topic contains 4 replies, has 4 voices, and was last updated by
June 4, 2014 at 3:27 pm #15903ParticipantPoints: 0Rank: Member
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? 🙂
June 4, 2014 at 7:13 pm #15905MemberPoints: 0Rank: Member
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.
June 4, 2014 at 11:34 pm #15907ModeratorPoints: 0Rank: Member
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.
Would you be able to post a suggestion on Connect and advertise on Twitter, Facebook, etc. to get votes?
June 5, 2014 at 12:34 am #15909ParticipantPoints: 0Rank: Member
Individual parameters are always explained in the cmdlet's help file.
help Get-Process -ShowWindow
help Get-Process -Parameter *
June 5, 2014 at 12:14 pm #15950ParticipantPoints: 0Rank: Member
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. 🙂
The topic ‘Is there an advanced Show-Command?’ is closed to new replies.