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

Written by: Tobias
5/9/2008 12:44 PM

In this blog, I cover features in PowerShell Plus. Feature #3: Cool Console Tricks

PowerShell Plus sports a real console, and that's good because it provides 100% PowerShell compatibility. However, our console is on steroids. Here are some things you can do with it:

Intellisense-like support: Simply type $host and enter a dot, and there you go: intellisense-like menus open to help you code. These menus don't popup always automatically. On .NET namespaces, you might want to press TAB to invoke them:

[System.Console]

And when you add a double-colon, again there are menus, showing you the static members.

[System.Console]::

Here are some other examples. Enter them, and then press TAB:

Get-WMIObject Win32_

Get-Help about_

c:\windows\

Another cool trick: drag a file into the console (or the editor for that matter): PS+ inserts its path. If you downloaded the latest version which is 1.0.3.3, here's another trick: drag a file and hold CTRL while you release it. The console will add the *file specific* code needed to access the file content or do something with it! So when you drag&drop an mdb access database, you get the database code, and when you do the same with an xml file, you get the xml access methods. There are a lot of file types supported already like accdb, ps1, doc and more, but you can expand this easily. Simply open the Internals/Hints-folder, and you'll immediately see how easy it is to add your own code templates based on file type.

And there are more tricks! For example, press F11 to open a snippet menu. You can insert your own favorite code snippets - and of course create new ones, but that's reserved for a future feature topic.

Finally, CTRL+C copies the current console line and CTRL+V pastes it, just like in a real windows window. Wait a minute. How can you break code if CTRL+C copies stuff? You still can because whenever PS+ executes code, it falls back to break mode.

If you don't like that, change it! You can even do it programmatically:

$psplus.AllowCtrlCForCopy = $false

Now, CTRL+C behaves like in any other console. You can still easily copy text to the clipboard. Simply press CTRL+N. And if you wonder what else you can control programmatically, check out this:

$psplus

$psplus | Get-Member -MemberType *method

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:
 

We have a new sponsor!  Introducting Pragma Systems.  See the home page for details.

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