PowerGUI® Script Editor Essentials 2.0

Last week I had an absolutely incredible week at the 2011 MVP Summit.  It was without a doubt the best business trip I have ever taken, bar none.  What makes a conference great for me is not the sessions (although the sessions were awesome).  For me it’s all about the attendees.  Being able to interact every day for an entire week with PowerShell MVPs and Microsoft PowerShell team members was truly an incredible experience, something that you just don’t get day to day when you’re in the office dealing with so many distractions.

While at the Summit I was meeting with some PowerShell MVPs, chatting about PowerGUI and PowerGUI Pro, and getting feedback on the two products (and taking a lot of notes!).  Claus Nielsen, a fellow PowerShell MVP from Denmark was sharing some of his ideas with me and one feature he requested was scroll buttons for our tabbed document interface to allow you to scroll the view to other tabs.  This is useful when you have many tabs open and you want to reorganize them or just scroll through the ones you have open.

I get a lot of requests from the online community as well, some of which come via twitter.  These don’t necessarily come from MVPs, although the one I’m about to use as an example does.  Brian H. Madsen (@csharpzealot) tweeted about having issues when running PowerGUI and not realizing he was in the 32-bit version of the console on a 64-bit machine.  Since you can run PowerGUI in 32-bit or 64-bit, elevated or not, it can be very useful to know how you opened it when you are working with the product.

Other feedback comes in the form of direct email.  One of our internal support reps was trying to figure out how to tell what encoding was used when saving a ps1 file because he was working with another product that didn’t seem to support that encoding.

A lot of this feedback turns into enhancement requests for the core product, but there are also many ideas that turn into features I can quickly implement in an Add-on.  All of the ideas I just mentioned in this post fall into the latter case, and between early mornings in my hotel room in Bellevue last week and a little time yesterday afternoon, I have finished implementing these (and more) in version 2.0 of the PowerGUI Script Editor Essentials Add-on.  This Add-on is definitely one of my favorites, right up there with the Blue Console Add-on and the Script Signing Add-on.  It comes with an indispensible feature set and whenever I install PowerGUI on a new system I immediately notice that it is missing and have to install it right away.

PowerGUI Script Editor Essentials 2.0 includes the following enhancements:

  • You can now view and change the current file encoding by using the File | Encoding submenu.  The menu items in this submenu will automatically save the current file and the checked item indicates the current encoding for the current file.
  • You can now use scroll buttons to view all of the tabs that you have open.  These scroll buttons are enabled by default, but you can always hide them or bring them back by using the View | Tab Scroll Buttons menu item.
  • You can now see more useful status information in the status bar.  This includes:
    • the current file encoding for saved files;
    • the current process architecture (64-bit or 32-bit) for 64-bit machines; and
    • the current elevation status if you are running PowerGUI in an elevated process.
      Here’s a screenshot showing you what the Script Editor looks like in an elevated process on a 64-bit system once you have this Add-on loaded:


I also fixed an issue preventing the shortcuts in this Add-on from working on some non-English operating systems, and I added icons that were missing for the Increase Indent and Decrease Indent menu items so that they show up as regular buttons if you add them to your toolbar.

These features are in addition to the features that came in the first version of this Add-on, which include support for :

  • enabling Word Wrap in your documents;
  • showing Whitespace in your documents;
  • using Virtual Whitespace when editing documents;
  • Zoom in and Zoom out while working with a document;
  • opening multiple files at once from the File | Open dialog; and
  • filtering for *.ps1xml, *.psc1, *.xml and *.txt files in the File | Open dialog.
    If you’d like to try this Add-on, follow these three steps:

1. Open the PowerGUI Script Editor and select Tools | Find Add-ons Online… in the menu.

2. In the dialog that appears, enter “Script Editor Essentials” into the text box and click on the Search button.

3. Once the Script Editor Essentials Add-on shows up in the results, click on the Add-on to select it and then click on the Install button to install the Add-on. This will download, unblock, install and load the Add-on in your Script Editor, and you’ll have these features in your favorite Script Editor in no time!

If you’re not connected to the web, you can also install this manually by following the steps outlined on the Script Editor Essentials Add-on page on PowerGUI.org.

    Now that this update is released, what else do you think qualifies as a Script Editor Essential feature?  As you can see, community feedback drives what we do, so please share your ideas!  We are listening.

Kirk out.

Create your own color theme for the embedded console in PowerGUI®

I really like the native PowerShell console look and feel.  Something about the blue theme applied to the native console puts me in a comfort zone, and it just works for me.  For a long time I have wanted to have the exact same color theme to be applied to the embedded PowerShell console in PowerGUI, and with the release of PowerGUI 2.4 I can finally create that theme.

Here’s what the themed console looks like in PowerGUI now that we have full color support:


If you would like the same experience in your embedded console, all you need to do is install the Blue Console Add-on in PowerGUI by following these three steps:

1. Open the PowerGUI Script Editor and select Tools | Find Add-ons Online… in the menu.

2. In the dialog that appears, enter “Blue Console” into the text box and click on the Search button.

3. Once the Blue Console Add-on shows up in the results, click on the Add-on to select it and then click on the Install button to install the Add-on.  This will download, unblock, install and load the Add-on in your Script Editor, and you’ll have a native blue theme applied in no time!

If you’re not connected to the web, you can also install this manually by following the steps outlined on the Blue Console Add-on page on PowerGUI.org.

Now that the PowerGUI Script Editor SDK supports any color in the embedded console, you can even create your own themes.  The Add-on is just a PowerShell module and you can look at how it sets the colors internally to see how you could create your own theme.  If you’re feeling ambitious, you could even build a theme-chooser Add-on something like the Script Colors Add-on by Denniver Reining and allow people to import/export color themes so that they can share them with one another.  I think an Add-on like that would be fantastic for the Script Editor, and I can already think of a half dozen features I’d like to see in it.  If you’re going to create an Add-on, be sure to install the Authoring Toolkit Add-on that I blogged about yesterday so that you’re working with all of the tools available to make it easier for you.


Kirk out.

PowerGUI® Script Editor Authoring Toolkit Add-on 2.0

Have you ever thought of a feature that you wished was included as part of the PowerGUI Script Editor?  When thinking about features you would like to see, did you realize that you can create many features yourself and share them with others?  The rich Add-on SDK that is included in the PowerGUI Script Editor allows you to do just that.  This SDK allows you to customize the Script Editor to your hearts content, adding, modifying or removing menus, submenus, menu items, toolbar, toolbar buttons, editor commands, or dockable windows.  It also allows you to work directly with the contents of documents that are open in the editor, or use events to control editor behaviour.

Today Add-on creation with the PowerGUI Script Editor SDK just got even easier.  I just published version 2.0 of the Authoring Toolkit Add-on on PowerGUI.org.  This Add-on adds a File | New | Add-on… menu item as well as a toolbar button to facilitate the creation of the Add-on itself, just like it did before.  What it also includes now though is a set of 49 snippets that facilitate working with the Script Editor SDK.  Want to create a new menu item?  There’s a snippet for that.  How about a toolbar button?  Or a dockable window?  There are snippets for those too.  There are even snippets for adding invoking and invoked events to commands included in the editor, allowing you to override or extend the behaviour of commands that are included in the Script Editor by default.  Some of these snippets were previously published as a separate download that you had to manually install on your system.  In the new 2.0 release, there are about 50% more snippets than in the past, the existing snippets have been updated to support new features added to PowerGUI 2.4, and these snippets are automatically installed with the Authoring Toolkit Add-on so that you can get started with your own Add-ons much more quickly.

To experiment with Add-on creation, all you need to do is follow four easy steps:

1. Open the PowerGUI Script Editor and select Tools | Find Add-ons Online… in the menu.

2. In the dialog that appears, enter “Authoring Toolkit” into the text box and click on the Search button.

3. Once the Authoring Toolkit Add-on shows up in the results, click on the Add-on to select it and then click on the Install button to install the Add-on.

4. Wait a moment while the Add-on downloads, unblocks, installs and loads in the Script Editor.  Now select File | New | Add-on… to start creating an Add-on and then with your Add-on psm1 file open, select Edit | Insert Snippet… to start inserting Add-on snippets in your Add-on.

Once you have the Authoring Toolkit Add-on installed, I recommend watching the “Create an Add-on in 10 Minutes” screencast to see how you can create your own Add-on.  Fast forward the parts that show you how to set-up the Add-on and the snippets because you just did that, and watch the rest of the demo showing how you can create your own Add-on in only 10 minutes.

At this point you should be pretty much ready to get started with your first Add-on, but extra documentation never hurts.  If you would like to read more about Add-on creation, I recommend the Add-on SDK documentation and the Building Your First PowerGUI Script Editor Add-on tutorial.  Both of these resources may come in handy as you experiment with the Add-on SDK.

Thanks for listening, and if you have any feedback or suggestions that you would like to share, or questions you would like to ask about Add-on creation or anything else PowerShell or PowerGUI related, I’m always listening.

Kirk out.

PowerGUI® Challenge: Have you taken the challenge yet?

In 10 days on November 15, the 2010 PowerGUI Challenge comes to a close.  The PowerGUI Challenge is a contest that gives you a chance to win some money while having fun with PowerShell and PowerGUI.  The rules are pretty simple: create a PowerPack or an Add-on for PowerGUI and post it in the contest folder for a chance to win one of the prizes.  The best part is that it is possible to create a contest entry in 10 minutes once you do a little research and watch a few videos.  That’s only 1 minute a day for the next 10 days, or a fun 10 minute break from doing something else that you really don’t want to be doing.  If you want to learn more, here is what you need to do:

1. Review the contest details on the contest page (http://www.powergui.org/contest.jspa).  That should answer a lot of the up front questions you might have and it will highlight a few useful resources (but I’m going to highlight some of the most important ones here as well).

2. Take a moment and watch this screencast that demonstrates how easy it can be to create a really useful Add-on for the PowerGUI Script Editor:

3. Now that you know what an Add-on is and how easy it can be to create one, take a few more minutes and watch this screen cast that demonstrates how easy it can be to create a really useful PowerPack for the PowerGUI Admin Console:

4. Create your Add-ons and PowerPacks and post them to the contest folder once you have them working.  The earlier you post your entries, the more time you will have to collect valuable feedback so that you can polish them up before the contest ends on November 15th, and the more you participate the more chances you have to win (some of the prizes are based on level of participation, others are based on best PowerPack or Add-on).

What a great way to spend time having fun with PowerShell and PowerGUI on those dull, Fall days!

Good luck with your entries, and don’t hesitate to ask questions to myself or any of the other judges!

Kirk out.

How to create PowerGUI® Script Editor Add-ons the easy way

In case you haven’t heard, there is a contest coming up that gives you the opportunity to win some money while having fun with PowerShell and PowerGUI.  In order to win something in the contest you have to enter, and in order to enter you have to create either a PowerPack for the PowerGUI Admin Console or an Add-on for the PowerGUI Script Editor.  I have spent a lot of time creating Script Editor Add-ons over the past few months, and when you work on things like Add-ons it can be very helpful to have the right tools at your side.

One of my favorite tools that I like to use for any repetitive PowerShell scripting is PowerShell snippets.  A PowerShell snippet is an xml document (.snippet file) that defines a short piece of PowerShell script with a few fields that can be customized when the snippet is inserted into a script.  Think of a snippet as a little user interface for injecting small pieces of PowerShell script into larger scripts that you are work on.  Snippets are incredibly useful and easy to create and customize, allowing you to arm yourself with tons of useful pieces of PowerShell script and save yourself a lot of typing.

While working on the Add-ons I have been publishing I decided I should build up a collection of snippets so that I could focus my efforts on the core logic inside the Add-on that makes it do wonderful things like sign scripts, create modules, and build other Add-ons, and less on the trivial details like adding and removing menus, menu items, toolbars, toolbar buttons and dockable windows.  This effort has resulted in a collection of 31 snippets that make creating a PowerGUI Script Editor Add-on much easier and today I have published that collection so that anyone can use them when creating their own Add-ons!

If you want to see an example of how easy it is to insert one of these snippets, here is a screenshot showing the snippet menu that appears after I press Ctrl+I (or Edit | Insert Snippet), along with some of the nested folders and their contents showing some of the snippets that are available:


If you want to build Add-ons, these snippets make it much easier to get started.  All you need to do is the following:

1. Download the Authoring Toolkit Add-on version 1.0.2 or later.  In version 1.0.2 I updated the Add-ons that are generated such that they use a $pgse variable for the root of the Add-on SDK.  Most of the snippets are dependent on this variable, so you should either download this version of the Add-on or make sure you are using a $pgse variable as the root of the Add-on SDK in Add-ons you have already started building.

2. Download the Script Editor Add-on snippets.  The download page describes how to install the snippets.  Note that since they must be copied into a Program Files folder, you must have the proper permissions to put them there.

3. Create a new Add-on or open an Add-on you are already working on and start using the Edit | Insert Snippet menu item to build more extensions to the PowerGUI Script Editor UI.

Between the Authoring Toolkit, the tutorial, the SDK documentation, and now these snippets, you should now have plenty of tools available to make it easier for you to create snippets for the contest that starts on October 15th.  I’m looking forward to seeing your entries!

Kirk out.

P.S. As I was publishing this I thought of a bunch more snippets that could be useful, but this is a good first set to get you started. If you like snippets and there are other snippets you would like to see, related to Add-ons or anything else you do with PowerShell, let me know so that I can know where you would like to see more effort in the future.  Thanks!

PowerGUI® Online

With the PowerGUI Challenge contest only a few weeks away, you may be wondering where you can go to learn more about PowerGUI in preparation for the contest.  Or maybe you’re looking for inspiration for the kinds of things you can do by using PowerShell with PowerGUI so that you can plan an entry for the contest.  To help provide some assistance with this, a few minutes ago I just published the first release of the new PowerGUI Online Add-on.  This Add-on adds a new PowerGUI Online menu to your Script Editor that provides you with fast access to dozens of useful resources for PowerGUI.  It includes links to many online resources, including:

  • Contest resources
  • Discussion forums
  • Learning center
  • PowerPack categories
  • Script Editor Add-ons
  • PowerGUI Team members on Twitter
  • Developer resources (PowerGUI VSX)
  • The PowerGUI channel on YouTube
  • Request a script
  • and more!

There are a lot of online resources available to help you get the most out of PowerShell and PowerGUI, and this Add-on pulls them all together into one organized menu.

One thing I really like about this Add-on is that when you click on any of the items in this menu, if you are running the PowerGUI Script Editor in STA mode (which is the default) the associated web page will be loaded right in the Script Editor!  Here’s a screenshot showing the Add-on in action with the embedded web browser appearing as another tab in the Script Editor:


If you are not running in STA mode (which means you are running in MTA mode), then the web pages associated with the PowerGUI Online menu items will load in your default web browser when clicked on.

This is the first release of this Add-on, so please let us know what you think.  It’s really easy.  Just click on the Feedback menu item in the new PowerGUI Online menu and leave us a note on our forums.

Kirk out.

P.S. Keep watching this blog for more useful content related to the PowerGUI Challenge contest that is coming soon.

Use-PowerShell | Enter-Contest | Receive-Prize

Ladies and gentlemen, start your engines!  The 3rd annual PowerGUI® Challenge is about to begin!

That’s right, this year Quest Software is sponsoring yet another PowerShell contest that gives you a chance to win some money by having fun with PowerShell and PowerGUI.  I’m totally excited about the contest this year, because there are more prizes, more categories, more judges, and more possibilities with what you can do than ever before!  If any of your entries make it into the top 10 in the two main categories (PowerPacks and Add-ons), they will be put in front of our incredible panel of celebrity judges for review and suggestions.  Judges this year include Jeffrey Snover, Hemant Mahawar, Don Jones, Jeffery Hicks, Shay Levy, Brandon Shell, Aleksandar Nikolic, and Marco Shaw.  If you’ve read even a little bit about PowerShell on the web, I’m sure a few of those names ring a bell.  Dmitry and I will review the entries and offer our own feedback as well.

Sound interesting?  Here’s what you should do:

  1. Head on over to the PowerGUI Challenge contest page and read all of the details about the contest, paying close attention to the tips and the resources that are listed there to help you out.
  2. If you’re not familiar with them already, take a look at the kinds of things you can do with PowerPacks and Add-ons by visiting the PowerPack Library and the Add-ons Library and trying some of them out (and make sure you install the Authoring Toolkit Add-on if you plan on creating Add-ons yourself – it’s a real time-saver).
  3. Enter the contest!  The only way to make sure you don’t win anything is by not trying at all, and this is a really fun way to discover some of the cool things that you can do with PowerShell beyond regular scripting.

The contest runs from October 15 to November 15, so you have a lot of time to get yourself warmed up before the official start date, and then you can start adding your entries and getting community feedback.  Don’t wait, start learning more about what you can do by experimenting now!

In the meantime, I’ll be providing additional resources to help you out that I’ll announce on my blog as well, so keep your eyes open for more useful contest resources.

As always, don’t hesitate to ask questions if you have any.  As Alan Renouf (one of our winners in last year’s contest) knows, I’m more than happy to provide feedback and answer questions.

Happy scripting!

Kirk out.