In this blog post I will show some of the other great features that are available to use in ISESteroids.
Refactoring your script
One of the biggest features that ISESteroids has is the Refactor Script button. This button will when clicked rewrite your entire script for you and make it more readable. A few thing it will do is remove any unneccesary spaces, normalizing line endings, case correct for commands and parameters as well as automatically indent script blocks.
To acces this function we need to click the Toggle Auto-Formaton Addon button.
This will then open the Auto-Format options tab on the right side of your screen.
For most scripts using the basic function works well enough since in the advances tab all options are ticked by default, however if we want more control on whats changed in our script we can use the advanced tab. On this tab we can specify exactly what the refactor button will do to our script. When we have specified what we want the button to check for we can start the process by clicking the Fix Script Now button.
Simulating the running of a script
Another function we have in ISESteroids is the simulate function. With this button we can simply run our script without any changes being made to our test system while still checking if the script will run as expected.
Compatibility options in ISESteroids
Another great tool that I like to use are the Compatibility options. With this option we can target the versions of Powershell for which we would like to use our scripts. We can also generate a report from this option menu to see if there are any issues that we can expect to encounter if we try and use our script with certain versions of Powershell. This tool comes quite in handy if you have any older Powershell scripts lying around that aren’t working properly or need to be updated.
Converting a script to a .exe file
A handy feature ISESteroids has is that once we are done with a script we can save our PS1 script as a .exe file. This allows us to easily publish tools to for example, clear and reload the App-v cache and provide the script in a users startmenu as a .exe file.
The PSSharper function
Another great tool in ISESteroids is the PSSharper function. This function will point out any errors, suggestions, information, Performance issues and ignored rules that we have in our script. Some of these issues will ofcourse be corrected with the refactor button but its nice to know if we are ignoring any best practices or if there are ways to improve our scripting.
From the PSSharper tab on the right side of our screen we have the option to fix these issues immediately by either double clicking them or by clicking the Fix Now button to fix all selected issues.
Adding a digital signature
Another nice tool in ISESteroids is that we can use it to sign our scripts with a digital signature. To do this we need to click on the add Digital Signature button on the bottom right of the screen.
We then click on Add Signature.
Since we currently do not have one installed it will ask us if we want to create one. When we click on Yes it will ask us to save it.
With this tool we can create our own self signed certificate to sign our scripts with. Using the advanced options we can ofcourse sign our script with one provided by a certificate authority or one provided by another party, for example the company you work for.
The toggle Content Sensistive Help addon
Another handy feature is the Toggle Context Sensitive Help Addon in ISESteroids. This function will show us help information based on the command we have clicked in our script. It will then show us information on the right of our screen in the help tab. This help automatically updates whenever you switch your selection.
Intelliselect in ISESteroids
A nice function built into ISESteroids is Intelliselect. With this function we can for example quickly comment out a piece of a command. To do this we do the following, If the cursor is in the piece of a command in the function we want to comment out you hit CTRL+Q. This will then select the command or in this case Variable.
This will then select the command or in this case Variable.
When we hit CTRL+Q again it will then select the entire function
Now we can comment it out by hitting Ctrl+Shift+B
Another thing we can do with intelliselect is change a variable without having to go through our entire script. To do this we do the following. Select the variable you want to change and hit F2. This will highlight the variable you selected throughout your script.
Now you can just type to change the variable and it will be changed completely through your script. Nice and simple.
These are just some of the tools we have available in ISESteroids and I haven’t used them all yet. In my next post I will talk about some more features I have found and tested.