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:

image

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:

image

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.

Enjoy!

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:

image

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:

PowerGUIOnline.Menu

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.

PowerShell modules made easy with PowerGUI®

Today I have the pleasure of sharing another PowerGUI Script Editor Add-on with you that I recently finished and that I personally find extremely useful.  This Add-on is all about defining PowerShell modules.  It’s called the Module Management Add-on, and it adds the following commands to the PowerGUI Script Editor menu and toolbars:

  • New Module – facilitates the creation of brand new modules from scratch by creating the module folder as well as the script module (psm1) file and the module manifest (psd1) file that defines the module, pre-populating as many relevant details in the manifest as possible such as the module name, description and GUID, the copyright date, your name, your company name, etc. in the appropriate places.
  • New Module Manifest – facilitates the creation of manifest files for existing modules, pre-populating as many relevant details in the manifest as possible such as the module name, description and GUID, the copyright date, your name, your company name, and the complete listing of all files included in the module.
  • Convert to Module – facilitates creating a new module from an entire script file or from the selected portion of a script file (this also generates the manifest and it is a really easy way to convert from PowerShell 1.0-style ps1 files that act as a function library but cannot be unloaded to PowerShell 2.0 modules that can be loaded and unloaded as needed).

Here’s a screenshot showing what the File menu looks like after you have installed this Add-on:

Module Management Add-on Menu Additions

Also, this Add-on adds some of the more frequently used commands to the toolbar:

Module Management Add-on Toolbar Buttons

When you want to create a new module, you can either use the menu item or the toolbar button to create the new module, or simply press Ctrl+Shift+M.  This displays the following dialog:

image

The author and company name are pulled directly from your Windows Registry, and the description and version fields are assigned generic default values.  You can change these values however you like for your module, and the Add-on will remember the values (aside from name) for the next time you use this command.  Also, you can use this dialog to create child modules by specifying a name with backslashes in it.  The module that is generated will be placed in the WindowsPowerShell\Modules folder under your user Documents folder, with all files in a folder for the module.  As soon as you enter a name and then click on OK, the module will be created and both the script module (psm1) file and the manifest (psd1) file will open in the Script Editor for editing, allowing you to add them to source control right away if you are using PowerGUI Pro with the source control feature.  As an option, you can use this dialog to create a new module without a manifest by simply clearing all fields except for the Name field.

There may be cases where you already have a module that you have created, and you want to create a manifest for that module.  Or perhaps you have a module you are already working with and you want to create additional manifests for that module (this allows users to work with an entire module or only portions of that module).  In these cases, you can use the menu item to create the new manifest, or you can simply press Ctrl+Shift+N.  This displays the following dialog:

image

Look familiar?  It should.  Creating a module manifest for an existing module is very similar to creating a new module because most of the details you provide in this dialog are stored in the module manifest.  Just like when you create modules, you can modify these details that are provided by default and you can assign a name (with an optional relative path) for the module for which you are creating a manifest.  Once the manifest is created, the Script Editor will open the manifest file automatically.

The other useful feature included in version 1.0 of the Module Management Add-on is the Convert to Module command.  This can be invoked through the File menu or the toolbar button as well.  You can either convert an entire file to a module or, if you have any text selected in the file, only the selected text will be used in the new module.  Note that the original file and its contents are left intact during the conversion process.  To perform the conversion, simply open the file you want to use for the conversion and select the text you want to use as the base for your module or don’t select anything if you want to convert the entire file.  Then click on the Convert to Module command in the File menu or on the toolbar, and you will be presented with the following dialog:

image

Once more, this should look familiar.  All operations for creating modules and manifest accept the same input values because they are all used in each operation.  You simply provide the necessary details, or remove all fields except for the module name if you don’t want to use a manifest, and then click on OK for the module to be created and the appropriate files to be opened in the Script Editor for you.

These are all very useful features to have at hand, whether you are working on new modules in PowerShell 2.0 or creating PowerShell 2.0 modules from function libraries (ps1 files) that you created in PowerShell 1.0.

If this Add-on interests you, simply go to the Module Management Add-on page and follow the installation instructions provided there.

As with many other Add-ons I have created, this is an early version of the Add-on so I would love to get your feedback on it. Do you find it useful as is?  How you would like to see it improved in a future release?  Would you like to see a Module menu and/or toolbar with menu items to add functions and aliases?  What else would you like to see for improved module management?  I have ideas, but I don’t want to influence your feedback too much, so I’ll keep my ideas to myself and let you speak up about what else you would like to see in this Add-on or others.

As always, thanks for reading!

Kirk out.

Share this post:

Using PowerGUI® to manage security

One part of my job that I find particularly enjoyable is working closely with other members of the PowerShell Community.  It doesn’t take any time at all when working with these people to feel the passion and excitement that they have for Windows PowerShell and PowerGUI.  One such person I have been working with a fair amount recently is Vadims Podans.  Vadims is a PowerShell MVP from Latvia and you may have seen some of his work in the past on his blog or in the Enterprise PKI Management PowerPack that he entered in our PowerPack Challenge contest last year.  From my experience working with him I’ve come to learn that he knows a heck of a lot about PKI and security in general, not to mention PowerShell.  Vadims’ expertise in these areas has resulted in quite a few new security-related releases in the past several weeks, as follows:

AD-PKI Cmdlets Tech Brief

Quest Software recently published an AD-PKI Cmdlets tech brief that was written by Vadims.  This tech brief reviews the security concepts surrounding digital certificate management and provides details and many examples showing how the AD-PKI cmdlets can be used with Active Directory to simplify PKI management.

Download the AD-PKI Cmdlet Tech Brief here.

Enterprise PKI Management PowerPack

Vadims recently released version 1.5 of his Enterprise PKI Management PowerPack.  This update includes support for the AD-PKI cmdlets that were introduced as part of the 1.4 release of the Quest AD cmdlets.  Notable features listed on the PowerPack page include:

  • A lot of code now uses native Quest AD Cmdlets (version 1.4.2) so the PowerPack demonstrates new PKI cmdlets in action!
  • Added additional error handling.
  • In Certification Authorities node added properties that contains helpful information about CA CRL status. In addition there was revisited View CRL action and renamed to View CRL Info
  • Added Active Directory PKI node that contains the most common AD PKI-related containers. You will be able to review container contents and publish/unpublish certificates/CRLs by using new actions.
  • Changed Enterprise OCSP location behavior. Now the PowerPack realizes the same behavior as it is implemented in pkiview.msc MMC snap-in. Now the PowerPack correctly retrieves all available Enterprise OCSP Responders even if they are not running CA service
  • For Certificates node added two subcontainers (subnodes, as shown in the last screenshot) — Certificates and CRLs. This allows you to browse both — certificates and CRLs in the local certificate store. For CRLs added new basic actions.
  • Revisited certificate export and import actions. In addition to Quest AD cmdlet usage, the interface is provided in GUI form. So now you will be able to use standard dialogs to select a file to save/open.

Learn more and download the Enterprise PKI Management PowerPack here.

Script Signing Add-on

Very shortly after I released the first version of the Script Signing Add-on for the PowerGUI Script Editor, Vadims provided me with some great feedback that I was finally able to incorporate into an update.  Yesterday I released version 1.1 of this Add-on, which includes the following changes:

  • Replaced “Test Certificate” functionality with View Signature, allowing users to view script signing certificates used to sign files in the native Windows Certificate properties dialog.
  • Added View Certificate support to the Script Signing Options dialog.
  • Changed the default signing method to include all certificates in the certificate chain.
  • Optimized the script signing certificate search algorithm so that it only searches for script signing certificates in the My containers.

Learn more and download the latest version of the Script Signing Add-on here.

And if that’s not enough for you, you can also keep your scripts secure by using the integrated source control functionality in the Script Editor in PowerGUI Pro so that you can track any and all changes that are made to your scripts whether they are signed or not!

Please let us know what you think of these and other releases, as well as what you would like to see us add in the future, either here or on the PowerGUI Forums.  The feedback system really works!

Kirk out.

Share this post:

PowerGUI Script Editor Essentials

Have you ever thought to yourself that it would be great if the PowerGUI Script Editor would allow you to…

select all of my files and open them at one time; or

turn on line/word wrap?

How about if it would allow you to…

…view white space characters (tabs and spaces); or

…move the cursor through the whitespace outside of a document while you edit the same column in multiple lines in your script; or

…zoom in or out using Ctrl+Add or Ctrl+Subtract so that you can adjust the font as necessary during presentations?

Some of these features were requested by members of our community, and others are features that I have wished for at one point or another.  As of today you can get all of these features in the PowerGUI Script Editor by simply downloading and installing the Script Editor Essentials Add-on!

How do I do that you ask?  Simply visit the Script Editor Essentials Add-on page and follow the installation instructions.  It shouldn’t take more than a few minutes to set up.  Once you have it set up, you can start using the new features right away.  For example, to enable the new features that affect your open documents, take a look at the new menu items in the Edit | Advanced menu:

ScriptEditorEssentials.EditAdvancedMenuExtensions.png

That menu allows you to enable the view white space, word wrap, or virtual white space features.  If you enable view white space, you’ll see tabs appear as arrows and spaces appear as dots, like in this screenshot:

ScriptEditorEssentials.ViewWhiteSpace.png

You can also turn on word wrap, which is great when working with documents that contain long lines of PowerShell script (unless you like scrolling back and forth horizontally when reading script lines).  It even shows a small arrow at the end of any lines that are wrapped, making it easier to distinguish between lines that wrap and lines that don’t:

ScriptEditorEssentials.WordWrap.png

All of these features can be turned on at the same time, allowing you to customize your experience for your needs, and the configuration is saved so that it persists between sessions.  Here’s another screenshot showing the virtual white space feature, which allows you to place the cursor anywhere on any line (normally you cannot place the cursor beyond the end of a line):

ScriptEditorEssentials.VirtualWhiteSpace.png

This feature can come in quite handy when you are modifying script on multiple lines in a similar column position, and when those lines aren’t necessarily adjacent to one another (I’ve had this experience which made me wish for this feature myself).

Do you ever show PowerShell to others, either via the web using desktop sharing or LiveMeeting or perhaps during presentations?  Being able to zoom in and zoom out on the fly can be useful if you do, so you may like these new menu items:

ScriptEditorEssentials.ViewMenu.png

They will increase or decrease the font size in the open documents as well as in the embedded PowerShell console by 1.  You can do this without this Add-on today by using Ctrl while moving your mouse wheel, but it is can be very difficult to control depending on your mouse sensitivity and it increases or decreases the font size by 10% instead of by a fixed value, plus it sets all fonts to the same font, which may not give you the results you are looking for (if you use the Blue Console Add-on, it applies a different font to the embedded console window).  The keyboard shortcuts for these menu items are very useful to learn if you ever show PowerShell to anyone while using the PowerGUI Script Editor.

And last, but not least, I have wanted to have multi-select support in the File Open dialog for a long time.  That support is now available, and while I was adding it I also flushed out the list of file extensions to include all PowerShell file extensions plus other extensions commonly used with PowerShell.  Here’s what that looks like once this Add-on is installed (you can click on the image to see it full size):

ScriptEditorEssentials.FileOpen

I would really appreciate any feedback that you would like to share on this (or any other) Script Editor Add-on.  I’ve called this Script Editor Essentials because it contains a variety of general editor features that I think are essential for anyone using the PowerGUI Script Editor without being tied to a specific need.  That doesn’t mean it contains everything that is essential though, and there are a lot of other Script Editor Add-ons available that you should take a look at to see the other options available to you to enhance your script editing experience.  What features would you consider essential to you as you work with PowerShell files in the Script Editor that are not yet available in the core product or as an Add-on?  Let me know in the comments or on the PowerGUI Forums so that we can make sure we’re meeting your needs.

Also, I would be remiss if I didn’t point out that this Add-on, as well as all other Add-ons, are created using PowerShell modules.  There’s even an Add-on Authoring Toolkit that makes it easier to create Script Editor Add-ons, along with a tutorial showing you how you can create your own Add-ons!  Creating an Add-on can be pretty easy to do, so don’t be afraid to give it a try and use the PowerGUI Forums to ask questions as needed.

Hopefully this will be a useful and welcome addition to your PowerGUI experience.  Enjoy!

Kirk out.

Share this post: