Archive for the 'Script Editor' Category

Reset PowerShell Runspace in PowerGUI Script Editor

Here’s another neat feature we have added in PowerGUI 3.0 – ability to reset PowerShell runspace when you need to.

All you have to do is:

  • Go to Debug menu, and click Reset Runspace.

And that will give you a nice new shiny PowerShell session with no variables or other changes left from your preceding work!

You can also make PowerGUI automatically reset runspace each time you start debugging if you:

  1. On the Tools menu, click Options,
  2. On Debug Options tab, select Reset PowerShell runspace each time debugging is started.

I somehow prefer manual method to automated one because quite often there is value in left-over variables (you get intellisense for example!), loaded modules, and so on. However, I can then manually reset the runspace before my final debug session to make sure the script works fine in a clean environment.

Either way, now you have both options at your command! Happy scripting!

(Screenshot taken from the original PowerGUI 3.0 announcement which lists a lot of other great features we shipped in that release)

Advertisements

Get add-ons right in Script Editor

One of my favorite features in PowerGUI 2.4 is the add-on finder in PowerGUI Script Editor.

As you probably know, Script Editor has tons of extremely useful add-ons with great additional features: from script signing to built-in help explorer. However, you used to have to install the add-ons manually – and this was a bit of a hassle. Now, all you need to do is:

1. Go to Tools / Find Add-Ons Online,

2. Enter keyword to do a search (or just click Search to see everything),

3. Select the add-on you want and click Install.

That is it! Hopefully this makes your scripting experience even more exciting. 🙂

Advanced PowerShell Options in PowerGUI Script Editor

This add-on from James Brundage (from www.start-automating.com) lets you easily fine-tune the PowerShell host right in the PowerGUI Script Editor.

1. Download the PowerShell Preferences add-on from here,

2. Unblock the zip file,

3. Extract it to the My Documents \WindowsPowerShell \Modules folder,

4. In Script Editor’s File / PowerShell Libraries dialog box, select PowerShellPreferences.

And you will get this panel in the script editor, allowing you to change all the internal settings of the PowerShell host:

  • Command history size,
  • Error history size,
  • Mail server for send-mailmessage,
  • Strict mode (automated checking for variable initialization, etc.),
  • What-if mode (automatically running all cmdlets with -whatif flag),
  • Error level,
  • Warning level,
  • Debug level,
  • Verbose message level,
  • Progress message handling.

Combined, these give you incredible control over the way that PowerShell works – which in turn can help a lot when debugging your PowerShell scripts.

Download the add-on here.

Happy scripting!

Dmitry

PowerShell Help Browser

This great PowerGUI Script Editor add-on by Gyorgy Nemesmagasi gives you the ability to browse PowerShell help topics right in the Script Editor (you can make the help window either float or be docked in the IDE) which makes it super-easy to lookup any PowerShell info when you need it:

The coolest part is that the add-on is loading all the information dynamically – so the cmdlet and alias list will depend on the actual set of snapins and modules you have, and the help information is in your language!

Very helpful and well worth checking out. Download the PowerShell Help Browser add-on here and make your PowerShell scripting experience even better! 🙂

Automate your PowerShell demos

Delivering a talk? James Brundage has just released an add-on giving you a rich demo environment right within PowerGUI Script Editor!

So next time you want to show PowerShell, all you need to do is:

1. Install James’ add-on onto your machine,

2. From Demo / Select Demo, chose the demo script you want to use,

3.  Click Start Demo.

4. Then optionally undock the demo control window and move it to presenter screen so your audience does not see it 😉 and click Next as you proceed:

The demo will go command by command, at any time you can intervene and just execute something in the PowerShell Console pane, show variables, and so on. And obviously when you are done – you can just switch to another script.

This is basically Jeffrey’s start-demo script + ability to see the demo library right in the PowerGUI Script Editor + the nice reach environment with intellisense and other goodies!

Next time you present PowerShell – use James’ demo tool. Download it right away and give it a try.

This add-on is participating in the PowerGUI Challenge 2010. Got a great add-on idea? Take part in the contest!

Set your syntax colors

Tweak color and font for any PowerShell element in PowerGUI Script Editor with this Script Color add-on which Denniver Reining from BitSpace.de has just posted:

Syntax highlightcolor picker for PowerShell in PowerGUI Script Editor

If you spend a lot of time scripting, you might have your own preferences  on the way your scripting environment displays keywords, cmdlet names, variable and so on. You used to be able to tweak these in PowerGUI Script Editor by manually locating and modifying one of our configuration files. Now there is an easy to use friendly graphical interface provided by Denniver’s add-on.

Download Script Color add-on and make PowerGUI Script Editor the PowerShell IDE of your dream!

Denniver’s add-on is participating in the PowerGUI Challenge 2010. Got a great add-on idea? Take part in the contest!

 

 

Formatted PowerShell everywhere

Getting PowerShell scripts with syntax highlight and line numbers into your blog, Word document or Outlook email is now easier than ever before! Once you download Karl Mitschke‘s Copy to Colorized HTML add-on, extract it to the modules folder and select it in the PowerShell Libraries dialog box, you’ll get Edit / Copy As / Colorized HTML (Ctrl-H) command  added to PowerGUI Script Editor menu.

Select the script, click the command, then paste the code into your email, document or other rich text control editor such as Live Writer.

Note, that this add-on is different from the native Copy As / HTML functionality which puts into clipboard plain text with HTML tags – this you would paste into HTML editing window of your blog, Karl’s add-on output – into a rich text editor. Nice complementary pieces of functionality. Now we got everything covered!

Karl’s add-on is participating in the PowerGUI Challenge 2010. Got a great add-on idea? Take part in the contest!


My Recent Tweets

Legal

The posts on this blog are provided “as is” with no warranties and confer no rights. The opinions expressed on this site are mine and mine alone, and do not necessarily represent those of my employer - WSO2 or anyone else for that matter. All trademarks acknowledged.

© 2007-2014 Dmitry Sotnikov

August 2019
M T W T F S S
« Oct    
 1234
567891011
12131415161718
19202122232425
262728293031  
Advertisements

%d bloggers like this: