This add-on will take a long script line and convert it to a splatted format (using Create Splat (Ctrl L)).

turns into this:

If you have text selected, the add-on will convert only the selected text to splatted style.
I have updated this to handle missing quotes.
11/7/2010 I have updated it to turn splatted command lines into single lines (using Remove Splat (Ctrl t)).
This:

Becomes this:

11/11/2010 Updated to fix a few bugs 1) Handles parameters with spaces 2) Implement a try/catch
11/12/2010 I have updated this to handle the boolean $true and $false 11/13/2010 I have updated this to handle spaces in parameter values and blank switches. blank switches will default to $true
12/1/2010 I have killed two bugs - One that added spaces before and after the value, and on that did not default blank switches to $true 12/1/2010 Added the feature of expanding an alias into its definition for the cmdlet (first position in the string).
12/29/201 Updated to handle dashes ("-") in a parameter value. 01/07/2011 Fixed a "feature" that dropped a parameter value of 0 - you can now use integers or floats for values.
To install the add-on, follow these steps: 1) Download the file from the Downloads box at the right of this page, and extract it into your module folder. (C:\users\\Documents\WindowsPowerShell\Modules) 2) In the File / PowerShell Libraries dialog box, select Add-on.CreateSplat.
|