icomasoft PowerScripter 1.5  
Editing and Debugging Scripts

As we strive to integrate and not to seperate, we included the PowerGUI support.

If you haven't done so yet, please install PowerGUI now: http://www.powergui.org

The simplest way to edit or debug a script with PowerGUI is to select the relevant script in the PowerScripter Edit script context menu:

Alternatively, hold the shift key while clicking on the context menu object.


If PowerGUI is correctly installed, the script will open with the free editor. Otherwise nothing happens.

If you use the debug function of PowerScripter,  the script will be slighty changed by adding PowerScripter - PowerGUI debugger regions. Therefore, you can directly edit your script and do a debug run without having to logon to the VMware server or to select an object.

Original script to disconnect any network adapter:

#--name Connect VM Network
#--hideoutput
$_ | Get-NetworkAdapter | Set-NetworkAdapter -connected:$true -Confirm:$false

PowerScripter debug mode script:

#region PowerScripter - PowerGUI debugger
#do not edit manually
Get-VM
"virtualmachine" | % {
#endregion

#--name Connect VM Network
#--hideoutput
$_ | Get-NetworkAdapter
| Set-NetworkAdapter -connected:$true -Confirm:$false

#region
PowerScripter - PowerGUI debugger
#do not edit manually
}
#endregion

Important: PowerScripter removes the region automatically when the script runs for the first time outside of PowerGUI again! You do not need to care about these regions at all.

Steps to debug a script:

  1. Shift key + mouse click on the context menu entry of the script
  2. edit the script
  3. do a debug run
  4. save the script and close PowerGUI
  5. run script like normal through PowerScripter

Exception: It's not possible to edit or debug scripts from a PowerPack file content


 
Copyright © 2009 icomasoft ag, Switzerland