I have been using various tools/Add-ons to write PowerShell scripts and wasn’t really found good one until one of my colleague Dave introduced to this link http://www.powertheshell.com/isesteroids2 . I have to be honest saying this blown away my needs and wants are all in one tool which is ISE Steroids. So now I’m going to walk through some of the aspects of it. I won’t go in detail of basic setup procedure because there are articles available already.
Below are quick overview of what actions to do for getting started with ISE Steroids
For this article I’m using PowerShell version 5.0
- ISE Steroids 2.0
- Download & Install
- Running ISE Steroids
- Explore the ISE Steroids Magic
Below is the screen snapshot of how ISE editor will look with ISE Steroids.
Let’s Start the ISE Editor by running Start-Steroids, After the ISE steroids have been launched you can see lot of options and commands available. We will walk through in few moments.
- I personally do not want to run the command Start-Steroids every time I launch PowerShell ISE.
Click on the Highlighted blue circle to launch the personal ISE AutoStartup scripts, then add a line and save the Microsoft.PowerShellISE_Profile.ps1 script. As shown below
Now, if you launch the PowerShell Editor you will have the ISE Steroids loaded automatically.
This is useful when writing a long script and need to quickly navigate back to revisit a code or block of parameters etc. Click on the Green Bookmark symbol as shown in the below screenshot.
When we write lot of code/scripts, we need to have the readability at of the code at the maximum. This LiteralView feature will help you to achieve in a top notch manner.
Below is the code snippet before we Turned on the LiteralView
Now let’s turn on the LiteralView by clicking the Blue circle item as shown in the below screenshot. You can see the difference of readability as highlighted in the red box. Also, you can right click the LiteralView Icon to change the preferences of Font style, sizes.
Enabling Setting as shown in the below screenshot will be help to write the script quicker and more easier. I will provide a one liner description for each of the settings as indicated by the number index.
- Line Number Margin Enhancements
- Mark the Minor code style issues with the green squiggle in real-time
- Mark Major Code style issues that may influence script robustness with the blue squiggle in real-time
- Highlights Matching braces
- Automatic code completion suggestions
- Autocomplete quotes
- Autocomplete Braces
- Autocomplete Parenthesis
- Autocomplete Brackets
- Syntax Error will be shown in the lower left corner of the editor.
- Enable shorten runtime error messages.
- Monitors scripts for external file changes
- Line Number Margin Enhancements
The above description can also be found by selection each icon from the editor. This will help you to provide what’s available in the ISE Steroids
Some really useful Add-on toggles
Toggle Navigation Bar will help to choose the functions from the list, search in the scripts bar, exporting selection function to a PowerShell modules etc as shown in the below picture.
- Showing the command Add-on. This feature comes as part of ISE Editor
Toggle Variable Monitor, which is helpful during the debugging the scripts. You can add variable by right clicking a variable->Debugging->Monitor as shown in below screenshot
- Toggle Context sensitive help
- Toggle MagneticNotes Add-on
Toggle Refactoring Add-on
This feature I really like it because it will be able to remove the whitespace that follow backtick, replace illegal characters, NormalizeLineEndings, Removesemicolon, Normalizing variable and lot more. Below screenshot will be able to show you the complete list from the advanced section.
One of the example for refactoring is shown below
These Add-on as part of ISE Editor will Help to have a clean code easily and standardize the code within the team of scripting Ninjas.
One more refactoring benefits are, renaming the function will also replace the names in the references. Which is quite handy when a nonstandard function names are renamed to verb-noun format. Complete list of verb can be found under https://msdn.microsoft.com/en-us/library/ms714428%28v=vs.85%29.aspx
7. There is a version Management Tool available which is really handy sometimes to see the differences and the list of version can be compared by click the compare
Now let’s have a look at the quick shortcuts available in the ISE Steroids
Open the PowerShell ISE Editor with ISE Steroids loaded, type Func and Tab you will be able to get the function as shown below
Now, lets type try and Tab , you will be able to see the below try block.. However you have to had catch and/or finally block.
You can also have this same behaviours for ForeachObject, Basic for loop and lot more .. Even you can have your own created snippets in similar manner.
I really like the export functions into module, as shown below
The output will be created as shown below
Now when debugging the scripts, you will be able to see the call stack information and variables runtime values which are quite handy refer below screenshot
Last one for this blog post, this is Handy to bundle up the scripts if you need to run as executable which is located under Tool->Create Application
You can specify the required parameters and run them as standalone exe.
Hope this blog post have shown some of the great features the ISE Steroids have provided. If you have any question please contact me.