header
header Register : : Login header
header
divider
menuleft
menuright
submenu
left
May 11

Written by: Tobias
5/11/2008 12:51 PM

In this blog, I cover features in PowerShell Plus. Feature #4: Live Variable Monitor

There are tons of automatic PowerShell variables, and of course you can define your own. To keep track and explore variables, invoke the live variable monitor, simply by pressing CTRL+T. You get a list of all variables in current scope, and they are marked with star-symbols.

To understand what the symbols are for, click on the down-arrow next to the funnel-button. With the funnel, you filter the var list. You can for example exclude all automatic variables and focus on new or changed variables only. This way, the list only shows stuff that changes. Right next to the funnel, there's a text box. You can enter any regular expression here to further enhance filtering.

For example, to get a quick overview of all your preferences, enter Pref into the text box. Note while you type, the list gets filtered, so you can easily narrow down on anything you want to keep in focus.

When you click on a variable in the var list, the property panel helps you explore variable content. You can sort and categorize var properties all right, but what are those capsules for?

They are actually from the Matrix and control how you look at variables:

The blue capsule shows the variable object properties

The red capsule shows the underlying PSBase object which can be the same but often is a different object

The yellow capsule shows all methods and properties so it really is a GUI on Get-Member.

Note that when a variable contains a collection, there is a combo box in the property panel so you can view (and select) the collection memebers. Try this:

$a = dir

Next, click $a in the variable panel. You now see all individual files and subfolders in a combobox. When you select one, its properties are exposed in the property panel.

There is yet another hidden feature. Normally, the variable panel shows all variables in scope. You can switch that tool into a pipeline monitor, though. Simply click on the black console button left of the funnel. Now you are in pipeline mode, and the var list shows everything your last command has output. Try it! When you enter a Dir, you will see (and can finally explain to novices) that everything PS returns are rich objects.

Of course the property window works with pipeline content, too. And remember: when you're done exploring and examining, just press CTRL+T to hide the variable and property panel and maximize your working real estate in the console.

Enjoy!

Don't know PS+ yet? Go grab it: http://www.powershell.com/download/psp1.zip. Unzip, run. It's as easy as that. And it's free for non-commercial use. Enjoy!

Hungry for more? The latest (non-public) build is always available here: http://www.powershell.com/download/psp1new.zip. And the change log with the latest additions is available here: http://www.powershell.com/mantis/changelog_page.php.

Tags:
 

[August 25th, 2008] Check the home page regarding PowerShell related news from a brand new sponsor: Idera

Blogs
  
Search Blogs
  
Archives
  
right
   
footer Sponsored by Quest Software • SAPIEN Technologies • ShellTools, LLC • Microsoft Windows Server 2008 footer
footer