ISE option to collapse a cmdlets parameters and arguments to hash for splatting. - by mjolinor

Status : 


Sign in
to vote
ID 722513 Comments
Status Active Workarounds
Type Suggestion Repros 0
Opened 2/2/2012 6:38:42 AM
Access Restriction Public


In the ISE, it would be nice to have some mechanism to be able to enter a cmdlet with all of it's parameters in-line, and then tell the ISE to collapse those parameters and their values to a hash table for splatting.  

I wrote rough add-on that lets you enter a cmdlet, choose the parameter set you want and the parameters from that set you want to splat, and then writes a snippet to the script pane.  It's not pretty (it's using read-host and out-gridview to specify the cmdlet name and select the parameter set and parameters) but it basically shows how it would work.
Sign in to post a comment.
Posted by John Kavanagh on 3/27/2012 at 1:50 PM
I know PowerGUI had a community submitted splatting add-on that worked nicely; written by
Posted by mjolinor on 2/6/2012 at 12:23 PM
I created a rough proof-of-concept addin (check the link in the original suggestion). It would be a good candidate for a polished add-in if it doesn't get added as an integrated feature, but if it does also having an add-in seems like it would just be redundant.
Posted by Mark E. Schill on 2/4/2012 at 5:29 PM
This would be a great enhancement to the product itself, but mjolinor you should also create an addon to the ISE that allows you to select the cmdlet and parameters and convert it to a hashtable for splatting.