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:

VMware Infrastructure Management PowerPack – now with Visio 2010 support!

Tonight I have published a new version of the VMware Infrastructure Management PowerPack.  This release (version 2.4.0) is the first release that provides near 100% feature parity between both PowerGUI and the Virtualization EcoShell.  I say near 100% feature parity because PowerGUI supports displaying progress dialogs during calls to Write-Progress but the Virtualization EcoShell does not, so PowerGUI users have a minor leg up over the Virtualization EcoShell experience.  Depending on what environment you are coming from, you will notice some of the following improvements to this PowerPack:

  • Visio 2010 support for vDiagram functionality
  • Charts for virtual machines, datastores, and resource configuration data
  • Progress bars during the rendering of diagrams created with the vDiagram functionality
  • Improved layout in the nodes in the tree
  • Simplified connection logic, making it easier for you to reuse scripts generated by the PowerPack
  • Additional minor bug fixes

Note that version 4.1 of the VMware PowerCLI is not supported with this release at this time, due to a number of issues.  For now the only supported version of the VMware PowerCLI is version 4.0 U1.

If you are an existing user of this PowerPack, you will automatically get notified about the new version.  If you haven’t looked at this PowerPack yet and you manage VMware vSphere, Virtual Center, ESX, or ESXi hosts, I strongly encourage you to give this PowerPack a try.  You can download it here.  It provides an excellent management experience over those VMware hosts, and it’s free!

As usual, many of the enhancements we add in these releases are based on customer feedback on the PowerGUI Forums.  If you’d like to see more improvements to this PowerPack, please speak up and let us know on the forums.  We’re always listening!

Kirk out.

Share this post:

PowerCLI 4.1: A fork in the road

UPDATE 10-JAN-11: To deal with the issues identified below, I published a beta version of the VMware vSphere PowerPack with PowerCLI 4.1 or later support.  You can read more about the beta and how to install it here.

Earlier this week, VMware released version 4.1 of the PowerCLI.  This release brings some great improvements that the community has been waiting for, and you can read about them on the VMware PowerCLI site and a number of other blogs that have been publicizing the release.  I’m not here to talk about the new features and improvements however.  I’m writing this to notify you about the breaking changes that were introduced in this release that haven’t been discussed externally but that you will want to know about.

With version 4.1 of the PowerCLI, the VMware team has changed the namespaces used in the object model behind the PowerCLI.  The objects themselves have stayed the same, but the namespaces have changed.  This change has a number of impacts once PowerCLI 4.1 is installed, including but not limited to the following:

  • Any PowerShell function that uses strongly typed parameter names with the VMware PowerCLI 4.0 or earlier type names will no longer function properly without an update.
  • Any PowerShell script that uses the is or as operators with the VMware PowerCLI 4.0 or earlier type names type names will no longer function properly without an update.
  • Any PowerGUI extensions (read: PowerPacks) written for PowerCLI 4.0 or earlier will no longer function properly without an update.
  • Any PowerShell scripts that use the VMware PowerCLI 4.0 or earlier type names inside of Add-Type calls will no longer function properly.

In general, any code or script written that is dependent on these type names will have issues once you upgrade to PowerCLI 4.1.  It also means that once these items that don’t work with 4.1 are updated, they may no longer work with PowerCLI 4.0 and earlier.  Also note that these are just PowerShell-related impacts.  If you’re using other languages to manage or automate VMware you need to be aware of the impacts for those languages as well. Here are a few PowerShell-specific examples of the impact of these breaking changes:

  1. The PowerCLI Community Extensions won’t work with PowerCLI 4.1 until they have been updated, and once they have been updated they will not work with PowerCLI 4.0 and earlier as long as they continue to use strongly typed parameter names (which they should).
  2. Scripts on PoshCode like this one and this one will suffer the same fate since they use strongly typed parameters in the advanced functions.
  3. Blog posts like this one from Glenn Sizemore and this one by Maish Saidel-Keesing will only work with PowerCLI 4.0 and earlier unless they are updated.
  4. The VMware Infrastructure PowerPack for PowerGUI and the Virtualization EcoShell will return data from the nodes, however actions will not appear and icons and charts will not show up in the grid.
  5. The VMware Community PowerPack for PowerGUI and the Virtualization EcoShell will return data from the nodes, however actions will not appear and icons and charts will not show up in the grid.
  6. Any blog posts that mentions PowerCLI object types will now be out of date.
  7. Books like this one will contain examples that are now broken.

As you can see, the PowerCLI 4.1 release comes with changes that are pretty far reaching, and they are definitely going to cause confusion in the community.  Unfortunately, since these changes are now in the wild, we’re at a fork in the road where some community contributions will only support 4.0 and earlier for a while and others, as they start supporting 4.1 and later, may only support 4.1 and later depending on how they add that support.  Changes like this are never fun, so please be aware of these changes when considering when to upgrade PowerCLI in your environment. As far as the PowerPack issues go, we will add support for the PowerCLI 4.1 release to the VMware Infrastructure PowerPack soon, but it will take a little while for us to work out the details and do the appropriate testing.  Until then, please don’t upgrade the PowerCLI on your systems where you use the VMware Infrastructure PowerPack. Thanks, Kirk out.

Share this post: