PowerShell Studio Request - Format Script Enhancements
Posted: Sat Jan 30, 2016 9:00 am
Hello all,
just recently purchased PSS 2015 and I fell in love with the features and the ability to easily create GUIs which can be redistributed but thought propose couple of enhancement/ideas that I loved in the previous product I was using.
Remove Aliases
I know there is an option and a keybord shortcut but yet it would be nice if the Format Script button could expand any alias in the script automatically, I know this could sound minor but as it is best practice not to use aliases in scripts I think it would be nice to have this automatically fixed by PSS.
Enforce proper use of single vs double quotes
I think the title says it all, generally speaking it is a good habit to use single quotes by default unless we want PowerShell to make changes to the text or expand a variable within quotes.
Again this is not essential but reinforces good habits and would make it easier to stick to them.
Better formatting for long line of commands
I think an example is better than thousand words, I'm from Switzerland and the CSV delimeter over here is ";" rather than "," so someitmes it is handy to format output in place with a command similar to the following
It will run and it is readable but I think this is much nicer/easier to read and follow
Again non essential but when you're dealing with many scripts somtime written by other people who ignore (or are to lazy to follow) best practices it makes it easier to have your IDE fix human shortcomings.
Hope the above will make sense and if any further detail can be helpful please let me know and I'll be more than glad to elaborate further.
If I had to make a choice the last function/option is the one I would like to see implemented but guess that is a matter of personal taste.
Cheers L.
*EDIT* The script review rules I'm talking about are coming from here https://www.powershellgallery.com/packa ... On/0.6.2.0 which can be imported into standard Windows ISE.
just recently purchased PSS 2015 and I fell in love with the features and the ability to easily create GUIs which can be redistributed but thought propose couple of enhancement/ideas that I loved in the previous product I was using.
Remove Aliases
I know there is an option and a keybord shortcut but yet it would be nice if the Format Script button could expand any alias in the script automatically, I know this could sound minor but as it is best practice not to use aliases in scripts I think it would be nice to have this automatically fixed by PSS.
Enforce proper use of single vs double quotes
I think the title says it all, generally speaking it is a good habit to use single quotes by default unless we want PowerShell to make changes to the text or expand a variable within quotes.
Again this is not essential but reinforces good habits and would make it easier to stick to them.
Better formatting for long line of commands
I think an example is better than thousand words, I'm from Switzerland and the CSV delimeter over here is ";" rather than "," so someitmes it is handy to format output in place with a command similar to the following
- foreach ($csv in $reportFile) { (Get-Content $csv) | ForEach-Object -Process { $_ -replace ',', ';' } |Set-Content $csv }}
- foreach ($csv in $reportFile)
- {
- (Get-Content $csv) |
- ForEach-Object -Process {
- $_ -replace ',', ';'
- } |
- Set-Content $csv
- }
Hope the above will make sense and if any further detail can be helpful please let me know and I'll be more than glad to elaborate further.
If I had to make a choice the last function/option is the one I would like to see implemented but guess that is a matter of personal taste.
Cheers L.
*EDIT* The script review rules I'm talking about are coming from here https://www.powershellgallery.com/packa ... On/0.6.2.0 which can be imported into standard Windows ISE.