In case you can’t tell, I get excited about the tools I use. ISE Steroids has become a go-to tool for my PowerShell scripting needs and has helped me get even better at doing what I do. ISE Steroids v2.0 RC2 was released a couple days ago and there are some great new capabilities that can help you customize the development experience even further. One very powerful feature is what Tobias calls ‘Make it Yours.’

Make it Yours is a set of features that allow you to add custom commands to context menus in PowerShell ISE. We have always had this in some respect using the ISE’s native object model. You can create custom add-ons which execute any blocks of PowerShell code that you like. Make it Yours takes this one step further and allows you to create commands that run from the Menu Bar or the right-click context menu, and you can now add custom tools into the Menu Bar’s Tools menu.

Read more...

If you haven’t heard of it yet, there is a useful plugin for PowerShell’s ISE editor called ISE Steroids. Quietly developed over the last couple years by PowerShell MVP Tobias Weltner, ISE Steroids adds professional IDE features to the ISE with the aim of helping you script better, faster, and with less effort. Yesterday saw the release of the second release candidate of ISE Steroids version 2.0 and a host of new features along with it.

One of my favorite features of the ISE Steroids is the color theming support. This gives you the capability to theme nearly every part of the script editor, console pane, xml editor and even the GUI itself. In the spirit of community, I would love to see the community start developing their own themes and sharing them. To prove I’m not a hypocrite, here is my first shared theme:

Read more...

Hi folks! Today’s post will be a short one based on something I discovered while testing error handling in a module I’m working on.

One of my module functions enumerates all the variables in the current session and checks the data type of each value. The function will return any variable values that match a particular custom data type.

Inevitably some of the variables in any session are null. Since my code is looking for the TypeNames property of an object I use the 0 index of TypeNames to look at only the first value, an error is generated if there are no TypeName values:

Read more...

One question I have seen quite often in PowerShell forums is “How do I find the parent OU of a user/computer?” Turns out this isn’t immediately available for your objects. I typically use a string replace to infer the OU path from the distinguishedname of the object like this:

This works just fine, but what if you need this data outside of your scripts? It might be useful for this to always be included in your active directory queries.

Read more...

If you haven’t heard about it yet, ISE Steroids is a premium add-on for the PowerShell ISE that has tons of great new functionality for making your scripting experience more productive. I already covered it’s snippets manager here.

Well now we have a release candidate version of ISE Steroids version 2 that has packed even more into this tiny little box (seriously - 39 MB!) So far my favorite is the new UI Theme Manager which allows you to manage the code syntax highlighting colors, fonts, and more. One of the cool features I had heard about was the capability to change token highlighting colors on the fly using the right-click context menu.

Read more...

If you haven’t seen the Microsoft Virtual Academy series on Active Directory and PowerShell yet, you should check it out here. Hosted by Ashley McGlone and Jason Helmick, it has tons of information on how to get started using PowerShell to manage Active Directory and there is some great supplemental material that you can download and work through on your own.

Anyway, I was thinking about one of Jason’s comments in the series regarding PowerShell parameter naming conventions. Specifically he says that the -Properties parameter of Get-Aduser should be -Property instead. According to MSDN, PowerShell cmdlet parameter names should always be singular unless they only take multiple values as an argument. Since -Properties accepts either a single value or an array of values, it should instead be -Property.

Read more...

Scripting Outside the Box

If you are like me, you probably took up PowerShell as a way to address a particular business need. For me, that need was managing some aspects of Active Directory and Office 365. This is a great approach to learning the language, but it has its drawbacks as well. If you are only using PowerShell to deal with the systems that you normally manage then you can get caught up ‘in the box’ and your learning can stagnate. A challenge I faced early on was how to keep the pace of learning up and continue to challenge myself. What I began to look for were arbitrary challenges that could help me take my PowerShell problem solving to the next level. One website I found for this is Rosetta Code.

Read more...

“What’s in Your Profile?”

This is a question you see often in PowerShell blogs and forums. PowerShell profiles can be a powerful way to automate your command line environment and most importantly save typing and time.

In my previous post I went over how to make a portable PowerShell profile. In this post I’ll go over what I have in my profile scripts and why.

The Main Profile

In this profile script I configure most of the settings that will apply to both the PowerShell console and the ISE:

Read more...

As my PowerShell skills have progressed I began to use profile scripts to customize and extend the PowerShell experience. I tend to work from a few different computers at work, at home, and sometimes on the road and keeping these profiles in sync was often a hassle. Eventually I decided that what I needed was a way to automate the syncing of my profile on any machine that I use regularly.

PowerShell Profiles

A PowerShell profile is nothing more than a script that is run by default any time you load a PowerShell host. These scripts can contain any PowerShell code you would like to have dot-sourced into your session. There are six different profiles that will be run depending on the host and third-party hosts can add their own profile as well. I typically use the ‘Current User, All Hosts’ profile which ensures that whether I open the console or the ISE I will still have my customized experience.

Read more...

For those of us who write PowerShell scripts frequently, ISE Steroids version 2.0 comes with some exciting new features. My favorite feature is the graphical Snippet Manager. It extends the ISE’s code snippet capabilities far beyond what you get out-of-the-box. It allows you to easily define your own snippets in the ISE and assign shortcuts to each.

Once you have downloaded ISESteroids and unzipped it to your module path, run Start-Steroids from the ISE console window to launch it.

Read more...