<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>SAPIEN Technologies</title>
	<atom:link href="http://www.sapien.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sapien.com/blog</link>
	<description>Tools for IT Success</description>
	<lastBuildDate>Wed, 16 May 2012 19:44:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>PowerShell Studio: Creating Responsive Forms</title>
		<link>http://www.sapien.com/blog/2012/05/16/powershell-studio-creating-responsive-forms/</link>
		<comments>http://www.sapien.com/blog/2012/05/16/powershell-studio-creating-responsive-forms/#comments</comments>
		<pubDate>Wed, 16 May 2012 19:43:00 +0000</pubDate>
		<dc:creator>David Corrales</dc:creator>
				<category><![CDATA[PowerShell Studio 2012]]></category>
		<category><![CDATA[PrimalForms]]></category>
		<category><![CDATA[PrimalForms 2011]]></category>
		<category><![CDATA[Windows PowerShell]]></category>
		<category><![CDATA[Button]]></category>
		<category><![CDATA[Control Sets]]></category>
		<category><![CDATA[Controls]]></category>
		<category><![CDATA[Form]]></category>
		<category><![CDATA[job]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[PowerShell Studio]]></category>

		<guid isPermaLink="false">http://www.sapien.com/blog/?p=4297</guid>
		<description><![CDATA[<br/>When working with GUIs you may have noticed that the Form can freeze when running long scripts. Previously I discussed how to make your loops more responsive in this article, but not every long script comes in the form of a loop. If you truly want to make your forms responsive, you will need to [...]]]></description>
			<content:encoded><![CDATA[<br/><p>When working with GUIs you may have noticed that the Form can freeze when running long scripts. Previously I discussed how to make your loops more responsive in this <a href="http://www.sapien.com/blog/2011/07/15/primalforms-2011-creating-responsive-loops/">article</a>, but not every long script comes in the form of a loop. If you truly want to make your forms responsive, you will need to move these slow scripts into another thread and in the PowerShell world this means using jobs.</p>
<p>For those of you who aren’t familiar with PowerShell Jobs, they allow you to run scripts while freeing up the console to perform other tasks. In this case it will free up the GUI and allow it to respond to user input.&nbsp; This article will not cover the ins and outs of jobs and it expects the user has some basic knowledge of the jobs mechanism in PowerShell. For your convenience we will list the cmdlets that are directly related to jobs. Please refer to the <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/dd878288(v=vs.85).aspx">MSDN PowerShell Jobs help</a> page for more information. </p>
<p><strong>Job Cmdlets:</strong>
<p><strong><a href="http://technet.microsoft.com/en-us/library/hh849698.aspx">Start-Job</a></strong>
<p>Starts a background job on a local computer.
<p><strong><a href="http://technet.microsoft.com/en-us/library/hh849693.aspx">Get-Job</a></strong>
<p>Gets the background jobs that were started in the current session.
<p><strong><a href="http://technet.microsoft.com/en-us/library/hh849718.aspx">Receive-Job</a></strong>
<p>Gets the results of background jobs.
<p><strong><a href="http://technet.microsoft.com/en-us/library/hh849730.aspx">Stop-Job</a></strong> </p>
<p>Stops a background job.
<p><strong><a href="http://technet.microsoft.com/en-us/library/hh849742.aspx">Remove-Job</a></strong>
<p>Deletes a background job.
<p><strong><a href="http://technet.microsoft.com/en-us/library/hh849735.aspx">Wait-Job</a></strong>
<p>Suppresses the command prompt until one or all jobs are complete.
<p>&nbsp;
<p><strong>Caveats when using Jobs and Forms</strong>
<p>There are two caveats you need to keep in mind when using jobs within a Form.
<p>1. Never access or modify form controls directly from within a job. If you need to update a form control or show progress, use the Receive-Job cmdlet to gather any necessary information from the job first and then update the control from the main script. The form controls do not allow themselves to be accessed from a different thread (i.e., the job).</p>
<p>2. Don’t use Register-ObjectEvent cmdlet. To determine if a job is complete you will need to check the status of the job. If you try to register an event handler for the job’s StateChanged event using Register-ObjectEvent, you find that it will not seem to trigger while the form is displayed, unless you call the [System.Windows.Forms.Application]::DoEvents() method mentioned in the <a href="http://www.sapien.com/blog/2011/07/15/primalforms-2011-creating-responsive-loops/">Creating Responsive Loops</a> article.
<p>For example:
<pre><span style="color: #0000ff; font-weight: bold">Register-ObjectEvent</span><span style="color: #000000"> </span><span style="color: #3399ff">-InputObject</span><span style="color: #000000"> </span><span style="color: #8b0000">$Job</span><span style="color: #000000"> </span><span style="color: #3399ff">-EventName</span><span style="color: #000000"> StateChanged `
   </span><span style="color: #3399ff">-Action</span><span style="color: #000000"> {
            </span><span style="color: #0000ff; font-weight: bold">Write-Host</span><span style="color: #000000"> </span><span style="color: #ff0000">'State Changed'</span><span style="color: #000000">
            </span><span style="color: #8b0000">$form1</span><span style="color: #000000">.WindowState </span><span style="color: #0000ff">=</span><span style="color: #000000"> </span><span style="color: #ff0000">'Minimized'</span><span style="color: #000000"> </span><span style="color: #008000">#Will not work</span><span style="color: #000000">
            </span><span style="color: #008000">#Handle the events so the message will display</span><span style="color: #000000">
            [System.Windows.Forms.Application]</span><span style="color: #0000ff">::</span><span style="color: #000000">DoEvents()
           } </span></pre>
<p>Even with this work around you cannot access the form controls directly. Therefore, you will need to use a <a href="http://www.sapien.com/blog/2011/08/09/primalforms-2011-spotlight-on-the-timer-control/">Timer control</a> to check the job’s status periodically. </p>
<p><strong>Creating a Form that utilizes Jobs</strong> </p>
<p>Now that we covered the caveats, we can now begin to modify our forms so that it can handle jobs. </p>
<p>Version 3.0.3 of PowerShell Studio has a Control Set called “Button – Start Job”. If you look at the control set it inserts&nbsp; a button and a timer. The timer checks the status of a job that is created when the button is pressed. </p>
<p>Button Click Event: </p>
<p>The button creates a job, starts the timer and uses the tag property of the timer to track it.
<pre><span style="color: #8b0000">$buttonStart_Click</span><span style="color: #0000ff">=</span><span style="color: #000000">{
    </span><span style="color: #008000">#TODO: Set a script block or specify a script path</span><span style="color: #000000">
    </span><span style="color: #8b0000">$jobScript</span><span style="color: #000000"> </span><span style="color: #0000ff">=</span><span style="color: #000000"> {
        </span><span style="color: #0000ff">for</span><span style="color: #000000">(</span><span style="color: #8b0000">$i</span><span style="color: #000000"> </span><span style="color: #0000ff">=</span><span style="color: #000000"> </span><span style="color: #000000">0</span><span style="color: #000000">; </span><span style="color: #8b0000">$i</span><span style="color: #000000"> </span><span style="color: #0000ff">-lt</span><span style="color: #000000"> </span><span style="color: #000000">50</span><span style="color: #000000">; </span><span style="color: #8b0000">$i</span><span style="color: #0000ff">++</span><span style="color: #000000">){ </span><span style="color: #0000ff; font-weight: bold">Start-Sleep</span><span style="color: #000000"> </span><span style="color: #3399ff">-Milliseconds</span><span style="color: #000000"> </span><span style="color: #000000">100</span><span style="color: #000000"> }
        }

    </span><span style="color: #0000ff">try</span><span style="color: #000000">
    {
        </span><span style="color: #8b0000">$job</span><span style="color: #000000"> </span><span style="color: #0000ff">=</span><span style="color: #000000"> </span><span style="color: #0000ff; font-weight: bold">Start-Job</span><span style="color: #000000"> </span><span style="color: #3399ff">-ScriptBlock</span><span style="color: #000000"> </span><span style="color: #8b0000">$jobScript</span><span style="color: #000000">
        </span><span style="color: #008000">#$job = Start-Job -FilePath &lt;script path&gt;</span><span style="color: #000000">

        </span><span style="color: #8b0000">$buttonStart</span><span style="color: #000000">.Enabled </span><span style="color: #0000ff">=</span><span style="color: #000000"> </span><span style="color: #8b0000">$false</span><span style="color: #000000">
        </span><span style="color: #8b0000">$buttonStart</span><span style="color: #000000">.ImageIndex </span><span style="color: #0000ff">=</span><span style="color: #000000"> </span><span style="color: #000000">0</span><span style="color: #000000">
        </span><span style="color: #8b0000">$timerCheckJob</span><span style="color: #000000">.Tag </span><span style="color: #0000ff">=</span><span style="color: #000000"> </span><span style="color: #8b0000">$job</span><span style="color: #000000">
        </span><span style="color: #8b0000">$timerCheckJob</span><span style="color: #000000">.Start()
    }
    </span><span style="color: #0000ff">catch</span><span style="color: #000000"> [Exception]
    {
        </span><span style="color: #0000ff; font-weight: bold">Write-Debug</span><span style="color: #000000"> </span><span style="color: #8b0000">$_</span><span style="color: #000000">
        </span><span style="color: #008000">#Stop the Timer</span><span style="color: #000000">
        </span><span style="color: #8b0000">$buttonStart</span><span style="color: #000000">.ImageIndex </span><span style="color: #0000ff">=</span><span style="color: #000000"> </span><span style="color: #0000ff">-</span><span style="color: #000000">1</span><span style="color: #000000">
        </span><span style="color: #8b0000">$buttonStart</span><span style="color: #000000">.Enabled </span><span style="color: #0000ff">=</span><span style="color: #000000"> </span><span style="color: #8b0000">$true</span><span style="color: #000000">
</span><span style="color: #000000">        </span><span style="color: #8b0000">$timerCheckJob</span><span style="color: #000000">.Tag </span><span style="color: #0000ff">=</span><span style="color: #000000"> </span><span style="color: #8b0000">$null</span><span style="color: #000000">
        </span><span style="color: #8b0000">$timerCheckJob</span><span style="color: #000000">.Stop()
    }
}</span></pre>
<p>&nbsp;
<p>Timer Tick Event: </p>
<p>The Timer checks its Tag property, which contains the job object and checks the job’s State property to see if it is still running. If the job is complete, it stops the timer and enables the button, otherwise it continue to animate the button.
<pre><span style="color: #8b0000">$timerCheckJob_Tick</span><span style="color: #0000ff">=</span><span style="color: #000000">{
    </span><span style="color: #008000">#Check if the process stopped</span><span style="color: #000000">
    </span><span style="color: #0000ff">if</span><span style="color: #000000">(</span><span style="color: #8b0000">$timerCheckJob</span><span style="color: #000000">.Tag </span><span style="color: #0000ff">-ne</span><span style="color: #000000"> </span><span style="color: #8b0000">$null</span><span style="color: #000000">)
    {
        </span><span style="color: #0000ff">if</span><span style="color: #000000">(</span><span style="color: #8b0000">$timerCheckJob</span><span style="color: #000000">.Tag.State </span><span style="color: #0000ff">-ne</span><span style="color: #000000"> </span><span style="color: #ff0000">'Running'</span><span style="color: #000000">)
        {
            </span><span style="color: #008000">#Stop the Timer</span><span style="color: #000000">
            </span><span style="color: #8b0000">$buttonStart</span><span style="color: #000000">.ImageIndex </span><span style="color: #0000ff">=</span><span style="color: #000000"> </span><span style="color: #0000ff">-</span><span style="color: #000000">1</span><span style="color: #000000">
            </span><span style="color: #8b0000">$buttonStart</span><span style="color: #000000">.Enabled </span><span style="color: #0000ff">=</span><span style="color: #000000"> </span><span style="color: #8b0000">$true</span><span style="color: #000000">
</span><span style="color: #000000">            </span><span style="color: #8b0000">$timerCheckJob</span><span style="color: #000000">.Tag </span><span style="color: #0000ff">=</span><span style="color: #000000"> </span><span style="color: #8b0000">$null</span><span style="color: #000000">
            </span><span style="color: #8b0000">$timerCheckJob</span><span style="color: #000000">.Stop()
        }
        </span><span style="color: #0000ff">else</span><span style="color: #000000">
        {
            </span><span style="color: #0000ff">if</span><span style="color: #000000">(</span><span style="color: #8b0000">$buttonStart</span><span style="color: #000000">.ImageIndex </span><span style="color: #0000ff">-lt</span><span style="color: #000000"> </span><span style="color: #8b0000">$buttonStart</span><span style="color: #000000">.ImageList.Images.Count </span><span style="color: #0000ff">-</span><span style="color: #000000"> </span><span style="color: #000000">1</span><span style="color: #000000">)
            {
                </span><span style="color: #8b0000">$buttonStart</span><span style="color: #000000">.ImageIndex </span><span style="color: #0000ff">+=</span><span style="color: #000000"> </span><span style="color: #000000">1</span><span style="color: #000000">
            }
            </span><span style="color: #0000ff">else</span><span style="color: #000000">
            {
                </span><span style="color: #8b0000">$buttonStart</span><span style="color: #000000">.ImageIndex </span><span style="color: #0000ff">=</span><span style="color: #000000"> </span><span style="color: #000000">0</span><span style="color: #000000">
            }
        }
    }
}</span></pre>
<p>As you can see this works well with a single job and if you need multiple jobs to run at the same time then you have to create multiple timers.</p>
<p><strong></strong>&nbsp;</p>
<p><strong>Creating a new Job Tracker Framework</strong></p>
<p>Let’s expand on this idea and create a system that can scale and that only requires a single timer.</p>
<p>First we need a list that the system can use to track the current jobs. It is defined as follows:</p>
<pre><span style="color: #8b0000">$JobTrackerList</span><span style="color: #000000"> </span><span style="color: #0000ff">=</span><span style="color: #000000"> </span><span style="color: #0000ff; font-weight: bold">New-Object</span><span style="color: #000000"> System.Collections.ArrayList</span></pre>
<p>Next I created functions to interface with the JobTracker Framework. </p>
<p>The first function is <font color="#4f81bd">Add-JobTracker</font>. This function creates and adds a new job to the Job Tracker.&nbsp; It allows you specify a script block that the job will run and optional script block that will be called when the job is completed and another when the timer performs an update.</p>
<pre><span style="color: #0000ff">function</span><span style="color: #000000"> </span><span style="color: #008080">Add-JobTracker</span><span style="color: #000000">
{
    </span><span style="color: #008000">&lt;#
        .SYNOPSIS
            Add a new job to the JobTracker and starts the timer.

        .DESCRIPTION
            Add a new job to the JobTracker and starts the timer.

        .PARAMETER  Name
            The name to assign to the Job

        .PARAMETER  JobScript
            The script block that the Job will be performing.
            Important: Do not access form controls from this script block.

        .PARAMETER ArgumentList
            The arguments to pass to the job

        .PARAMETER  CompleteScript
            The script block that will be called when the job is complete.
            The job is passed as an argument. The Job argument is null when the job fails.

        .PARAMETER  UpdateScript
            The script block that will be called each time the timer ticks.
            The job is passed as an argument. Use this to get the Job's progress.

        .EXAMPLE
            Job-Begin -Name "JobName" `
            -JobScript {
                Param($Argument1)#Pass any arguments using the ArgumentList parameter
                #Important: Do not access form controls from this script block.
                Get-WmiObject Win32_Process -Namespace "root\CIMV2"
            }`
            -CompletedScript {
                Param($Job)
                $results = Receive-Job -Job $Job
            }`
            -UpdateScript {
                Param($Job)
                #$results = Receive-Job -Job $Job -Keep
            }

        .LINK

    #&gt;</span><span style="color: #000000">

    </span><span style="color: #0000ff">Param</span><span style="color: #000000">(
    [ValidateNotNull()]
    [Parameter(Mandatory</span><span style="color: #0000ff">=</span><span style="color: #8b0000">$true</span><span style="color: #000000">)]
    [string]</span><span style="color: #8b0000">$Name</span><span style="color: #000000">,
    [ValidateNotNull()]
    [Parameter(Mandatory</span><span style="color: #0000ff">=</span><span style="color: #8b0000">$true</span><span style="color: #000000">)]
    [ScriptBlock]</span><span style="color: #8b0000">$JobScript</span><span style="color: #000000">,
    </span><span style="color: #8b0000">$ArgumentList</span><span style="color: #000000"> </span><span style="color: #0000ff">=</span><span style="color: #000000"> </span><span style="color: #8b0000">$null</span><span style="color: #000000">,
    [ScriptBlock]</span><span style="color: #8b0000">$CompletedScript</span><span style="color: #000000">,
    [ScriptBlock]</span><span style="color: #8b0000">$UpdateScript</span><span style="color: #000000">)

    </span><span style="color: #008000">#Start the Job</span><span style="color: #000000">
    </span><span style="color: #8b0000">$job</span><span style="color: #000000"> </span><span style="color: #0000ff">=</span><span style="color: #000000"> </span><span style="color: #0000ff; font-weight: bold">Start-Job</span><span style="color: #000000"> </span><span style="color: #3399ff">-Name</span><span style="color: #000000"> </span><span style="color: #8b0000">$Name</span><span style="color: #000000"> </span><span style="color: #3399ff">-ScriptBlock</span><span style="color: #000000"> </span><span style="color: #8b0000">$JobScript</span><span style="color: #000000"> </span><span style="color: #3399ff">-ArgumentList</span><span style="color: #000000"> </span><span style="color: #8b0000">$ArgumentList</span><span style="color: #000000">

    </span><span style="color: #0000ff">if</span><span style="color: #000000">(</span><span style="color: #8b0000">$job</span><span style="color: #000000"> </span><span style="color: #0000ff">-ne</span><span style="color: #000000"> </span><span style="color: #8b0000">$null</span><span style="color: #000000">)
    {
        </span><span style="color: #008000">#Create a Custom Object to keep track of the Job &amp; Script Blocks</span><span style="color: #000000">
        </span><span style="color: #8b0000">$psObject</span><span style="color: #000000"> </span><span style="color: #0000ff">=</span><span style="color: #000000"> </span><span style="color: #0000ff; font-weight: bold">New-Object</span><span style="color: #000000"> System.Management.Automation.PSObject

        </span><span style="color: #0000ff; font-weight: bold">Add-Member</span><span style="color: #000000"> </span><span style="color: #3399ff">-InputObject</span><span style="color: #000000"> </span><span style="color: #8b0000">$psObject</span><span style="color: #000000"> </span><span style="color: #3399ff">-MemberType</span><span style="color: #000000"> </span><span style="color: #ff0000">'NoteProperty'</span><span style="color: #000000"> </span><span style="color: #3399ff">-Name</span><span style="color: #000000"> Job  </span><span style="color: #3399ff">-Value</span><span style="color: #000000"> </span><span style="color: #8b0000">$job</span><span style="color: #000000">
        </span><span style="color: #0000ff; font-weight: bold">Add-Member</span><span style="color: #000000"> </span><span style="color: #3399ff">-InputObject</span><span style="color: #000000"> </span><span style="color: #8b0000">$psObject</span><span style="color: #000000"> </span><span style="color: #3399ff">-MemberType</span><span style="color: #000000"> </span><span style="color: #ff0000">'NoteProperty'</span><span style="color: #000000"> </span><span style="color: #3399ff">-Name</span><span style="color: #000000"> CompleteScript  </span><span style="color: #3399ff">-Value</span><span style="color: #000000"> </span><span style="color: #8b0000">$CompletedScript</span><span style="color: #000000">
        </span><span style="color: #0000ff; font-weight: bold">Add-Member</span><span style="color: #000000"> </span><span style="color: #3399ff">-InputObject</span><span style="color: #000000"> </span><span style="color: #8b0000">$psObject</span><span style="color: #000000"> </span><span style="color: #3399ff">-MemberType</span><span style="color: #000000"> </span><span style="color: #ff0000">'NoteProperty'</span><span style="color: #000000"> </span><span style="color: #3399ff">-Name</span><span style="color: #000000"> UpdateScript  </span><span style="color: #3399ff">-Value</span><span style="color: #000000"> </span><span style="color: #8b0000">$UpdateScript</span><span style="color: #000000">

        [void]</span><span style="color: #8b0000">$JobTrackerList</span><span style="color: #000000">.Add(</span><span style="color: #8b0000">$psObject</span><span style="color: #000000">)    

        </span><span style="color: #008000">#Start the Timer</span><span style="color: #000000">
        </span><span style="color: #0000ff">if</span><span style="color: #000000">(</span><span style="color: #0000ff">-not</span><span style="color: #000000"> </span><span style="color: #8b0000">$timerJobTracker</span><span style="color: #000000">.Enabled)
        {
            </span><span style="color: #8b0000">$timerJobTracker</span><span style="color: #000000">.Start()
        }
    }
    </span><span style="color: #0000ff">elseif</span><span style="color: #000000">(</span><span style="color: #8b0000">$CompletedScript</span><span style="color: #000000"> </span><span style="color: #0000ff">-ne</span><span style="color: #000000"> </span><span style="color: #8b0000">$null</span><span style="color: #000000">)
    {
        </span><span style="color: #008000">#Failed</span><span style="color: #000000">
        </span><span style="color: #0000ff; font-weight: bold">Invoke-Command</span><span style="color: #000000"> </span><span style="color: #3399ff">-ScriptBlock</span><span style="color: #000000"> </span><span style="color: #8b0000">$CompletedScript</span><span style="color: #000000"> </span><span style="color: #3399ff">-ArgumentList</span><span style="color: #000000"> </span><span style="color: #8b0000">$null</span><span style="color: #000000">
    }

}</span></pre>
<p>A custom PSObject is used to keep track of the job and script blocks. Afterwards the PSObject is added to the Job Tracker list. Note: The corresponding job is passed as an argument to the CompletedScript and UpdateScript script blocks. This allows the user to use the Receive-Job cmdlet to access the full or partial results of a job.</p>
<p>Next we created a function called <font color="#4f81bd">Update-JobTracker</font>, which the timer uses to check the status of all the jobs in the Job Tracker List. If the job is complete, it will then call the job’s corresponding CompletedScript script block. Otherwise if the job is still running, it will then call the corresponding UpdateScript script block. If all the jobs are completed, then the function will stop the timer.</p>
<pre><span style="color: #0000ff">function</span><span style="color: #000000"> </span><span style="color: #008080">Update-JobTracker</span><span style="color: #000000">
{
    </span><span style="color: #008000">&lt;#
        .SYNOPSIS
            Checks the status of each job on the list.
    #&gt;</span><span style="color: #000000">

    </span><span style="color: #008000">#Poll the jobs for status updates</span><span style="color: #000000">
    </span><span style="color: #8b0000">$timerJobTracker</span><span style="color: #000000">.Stop() </span><span style="color: #008000">#Freeze the Timer</span><span style="color: #000000">

    </span><span style="color: #0000ff">for</span><span style="color: #000000">(</span><span style="color: #8b0000">$index</span><span style="color: #000000"> </span><span style="color: #0000ff">=</span><span style="color: #000000">0</span><span style="color: #000000">; </span><span style="color: #8b0000">$index</span><span style="color: #000000"> </span><span style="color: #0000ff">-lt</span><span style="color: #000000"> </span><span style="color: #8b0000">$JobTrackerList</span><span style="color: #000000">.Count; </span><span style="color: #8b0000">$index</span><span style="color: #0000ff">++</span><span style="color: #000000">)
    {
        </span><span style="color: #8b0000">$psObject</span><span style="color: #000000"> </span><span style="color: #0000ff">=</span><span style="color: #000000"> </span><span style="color: #8b0000">$JobTrackerList</span><span style="color: #000000">[</span><span style="color: #8b0000">$index</span><span style="color: #000000">]

        </span><span style="color: #0000ff">if</span><span style="color: #000000">(</span><span style="color: #8b0000">$psObject</span><span style="color: #000000"> </span><span style="color: #0000ff">-ne</span><span style="color: #000000"> </span><span style="color: #8b0000">$null</span><span style="color: #000000">)
        {
            </span><span style="color: #0000ff">if</span><span style="color: #000000">(</span><span style="color: #8b0000">$psObject</span><span style="color: #000000">.Job </span><span style="color: #0000ff">-ne</span><span style="color: #000000"> </span><span style="color: #8b0000">$null</span><span style="color: #000000">)
            {
                </span><span style="color: #0000ff">if</span><span style="color: #000000">(</span><span style="color: #8b0000">$psObject</span><span style="color: #000000">.Job.State </span><span style="color: #0000ff">-ne</span><span style="color: #000000"> </span><span style="color: #ff0000">"Running"</span><span style="color: #000000">)
                {
                    </span><span style="color: #008000">#Call the Complete Script Block</span><span style="color: #000000">
                    </span><span style="color: #0000ff">if</span><span style="color: #000000">(</span><span style="color: #8b0000">$psObject</span><span style="color: #000000">.CompleteScript </span><span style="color: #0000ff">-ne</span><span style="color: #000000"> </span><span style="color: #8b0000">$null</span><span style="color: #000000">)
                    {
                        </span><span style="color: #008000">#$results = Receive-Job -Job $psObject.Job</span><span style="color: #000000">
                        </span><span style="color: #0000ff; font-weight: bold">Invoke-Command</span><span style="color: #000000"> </span><span style="color: #3399ff">-ScriptBlock</span><span style="color: #000000"> </span><span style="color: #8b0000">$psObject</span><span style="color: #000000">.CompleteScript </span><span style="color: #3399ff">-ArgumentList</span><span style="color: #000000"> </span><span style="color: #8b0000">$psObject</span><span style="color: #000000">.Job
                    }

                    </span><span style="color: #8b0000">$JobTrackerList</span><span style="color: #000000">.RemoveAt(</span><span style="color: #8b0000">$index</span><span style="color: #000000">)
                    </span><span style="color: #0000ff; font-weight: bold">Remove-Job</span><span style="color: #000000"> </span><span style="color: #3399ff">-Job</span><span style="color: #000000"> </span><span style="color: #8b0000">$psObject</span><span style="color: #000000">.Job
                    </span><span style="color: #8b0000">$index</span><span style="color: #0000ff">--</span><span style="color: #000000"> </span><span style="color: #008000">#Step back so we don't skip a job</span><span style="color: #000000">
                }
                </span><span style="color: #0000ff">elseif</span><span style="color: #000000">(</span><span style="color: #8b0000">$psObject</span><span style="color: #000000">.UpdateScript </span><span style="color: #0000ff">-ne</span><span style="color: #000000"> </span><span style="color: #8b0000">$null</span><span style="color: #000000">)
                {
                    </span><span style="color: #008000">#Call the Update Script Block</span><span style="color: #000000">
                    </span><span style="color: #0000ff; font-weight: bold">Invoke-Command</span><span style="color: #000000"> </span><span style="color: #3399ff">-ScriptBlock</span><span style="color: #000000"> </span><span style="color: #8b0000">$psObject</span><span style="color: #000000">.UpdateScript </span><span style="color: #3399ff">-ArgumentList</span><span style="color: #000000"> </span><span style="color: #8b0000">$psObject</span><span style="color: #000000">.Job
                }
            }
        }
        </span><span style="color: #0000ff">else</span><span style="color: #000000">
        {
            </span><span style="color: #8b0000">$JobTrackerList</span><span style="color: #000000">.RemoveAt(</span><span style="color: #8b0000">$index</span><span style="color: #000000">)
            </span><span style="color: #8b0000">$index</span><span style="color: #0000ff">--</span><span style="color: #000000"> </span><span style="color: #008000">#Step back so we don't skip a job</span><span style="color: #000000">
        }
    }

    </span><span style="color: #0000ff">if</span><span style="color: #000000">(</span><span style="color: #8b0000">$JobTrackerList</span><span style="color: #000000">.Count </span><span style="color: #0000ff">-gt</span><span style="color: #000000"> </span><span style="color: #000000">0</span><span style="color: #000000">)
    {
        </span><span style="color: #8b0000">$timerJobTracker</span><span style="color: #000000">.Start()</span><span style="color: #008000">#Resume the timer    </span><span style="color: #000000">
    }
}</span></pre>
<p>We update the timer tick event to call the update Function from our Timer Tick event:</p>
<pre><span style="color: #8b0000">$timerJobTracker_Tick</span><span style="color: #0000ff">=</span><span style="color: #000000">{
    </span><span style="color: #008080">Update-JobTracker</span><span style="color: #000000">
}</span></pre>
<p>Note: You can modify the Timer’s Interval property to slow&nbsp; down or speed up the amount of time the timer waits before checking the progress of the pending jobs again.</p>
<p>&nbsp;</p>
<p>The final function of our Job Tracker Framework is the <font color="#4f81bd">Stop-JobTracker </font>function.&nbsp; This function will stop all pending jobs and remove them from the Job Tracker list. The function will also stop the timer. </p>
<p>Note: You can call the <font color="#4f81bd">Stop-JobTracker </font>function in response to the user closing the form. This ensures there are no pending jobs running after the fact.</p>
<p><span style="color: #0000ff">function</span><span style="color: #000000"> </span><span style="color: #008080">Stop-JobTracker</span><span style="color: #000000"><br />{<br />&nbsp;&nbsp; </span><span style="color: #008000">&lt;#<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .SYNOPSIS<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Stops and removes all Jobs from the list.<br />&nbsp;&nbsp;&nbsp; #&gt;</span><span style="color: #000000"><br />&nbsp;&nbsp; </span><span style="color: #008000">#Stop the timer</span><span style="color: #000000"><br />&nbsp;&nbsp; </span><span style="color: #8b0000">$timerJobTracker</span><span style="color: #000000">.Stop()<br />&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp; </span><span style="color: #008000">#Remove all the jobs</span><span style="color: #000000"><br />&nbsp;&nbsp; </span><span style="color: #0000ff">while</span><span style="color: #000000">(</span><span style="color: #8b0000">$JobTrackerList</span><span style="color: #000000">.Count</span><span style="color: #0000ff">-gt</span><span style="color: #000000"> </span><span style="color: #000000">0</span><span style="color: #000000">)<br />&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #8b0000">$job</span><span style="color: #000000"> </span><span style="color: #0000ff">=</span><span style="color: #000000"> </span><span style="color: #8b0000">$JobTrackerList</span><span style="color: #000000">[</span><span style="color: #000000">0</span><span style="color: #000000">].Job<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #8b0000">$JobTrackerList</span><span style="color: #000000">.RemoveAt(</span><span style="color: #000000">0</span><span style="color: #000000">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #0000ff; font-weight: bold">Stop-Job</span><span style="color: #000000"> </span><span style="color: #8b0000">$job</span><span style="color: #000000"><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #0000ff; font-weight: bold">Remove-Job</span><span style="color: #000000"> </span><span style="color: #8b0000">$job</span><span style="color: #000000"><br />&nbsp;&nbsp;&nbsp; }<br />}</span></p>
<p>&nbsp;</p>
<p>Now that we have a new framework, we can revise our initial Start Job button’s click event as follows:</p>
<pre><span style="color: #8b0000">$buttonStartJob_Click</span><span style="color: #0000ff">=</span><span style="color: #000000">{

    </span><span style="color: #8b0000">$buttonStartJob</span><span style="color: #000000">.Enabled </span><span style="color: #0000ff">=</span><span style="color: #000000"> </span><span style="color: #8b0000">$false</span><span style="color: #000000">    

    </span><span style="color: #008000">#Create a New Job using the Job Tracker</span><span style="color: #000000">
    </span><span style="color: #008080">Add-JobTracker</span><span style="color: #000000"> </span><span style="color: #3399ff">-Name</span><span style="color: #000000"> </span><span style="color: #ff0000">"JobName"</span><span style="color: #000000"> `
    </span><span style="color: #3399ff">-JobScript</span><span style="color: #000000"> {
           </span><span style="color: #008000">#--------------------------------------------------</span><span style="color: #000000">
        </span><span style="color: #008000">#TODO: Set a script block</span><span style="color: #000000">
        </span><span style="color: #008000">#Important: Do not access form controls from this script block.</span><span style="color: #000000">

        </span><span style="color: #0000ff">Param</span><span style="color: #000000">(</span><span style="color: #8b0000">$Argument1</span><span style="color: #000000">)</span><span style="color: #008000">#Pass any arguments using the ArgumentList parameter</span><span style="color: #000000">

        </span><span style="color: #0000ff">for</span><span style="color: #000000">(</span><span style="color: #8b0000">$i</span><span style="color: #000000"> </span><span style="color: #0000ff">=</span><span style="color: #000000"> </span><span style="color: #000000">0</span><span style="color: #000000">; </span><span style="color: #8b0000">$i</span><span style="color: #000000"> </span><span style="color: #0000ff">-lt</span><span style="color: #000000"> </span><span style="color: #000000">50</span><span style="color: #000000">; </span><span style="color: #8b0000">$i</span><span style="color: #0000ff">++</span><span style="color: #000000">){ </span><span style="color: #0000ff; font-weight: bold">Start-Sleep</span><span style="color: #000000"> </span><span style="color: #3399ff">-Milliseconds</span><span style="color: #000000"> </span><span style="color: #000000">100</span><span style="color: #000000"> } 

        </span><span style="color: #008000">#--------------------------------------------------</span><span style="color: #000000">
    }`
    </span><span style="color: #3399ff">-CompletedScript</span><span style="color: #000000"> {
        </span><span style="color: #0000ff">Param</span><span style="color: #000000">(</span><span style="color: #8b0000">$Job</span><span style="color: #000000">)
        </span><span style="color: #008000">#Enable the Button</span><span style="color: #000000">
        </span><span style="color: #8b0000">$buttonStartJob</span><span style="color: #000000">.ImageIndex </span><span style="color: #0000ff">=</span><span style="color: #000000"> </span><span style="color: #0000ff">-</span><span style="color: #000000">1</span><span style="color: #000000">
        </span><span style="color: #8b0000">$buttonStartJob</span><span style="color: #000000">.Enabled </span><span style="color: #0000ff">=</span><span style="color: #000000"> </span><span style="color: #8b0000">$true</span><span style="color: #000000">
    }`
    </span><span style="color: #3399ff">-UpdateScript</span><span style="color: #000000"> {
        </span><span style="color: #0000ff">Param</span><span style="color: #000000">(</span><span style="color: #8b0000">$Job</span><span style="color: #000000">)
        </span><span style="color: #008000">#$results = Receive-Job -Job $Job -Keep</span><span style="color: #000000">
        </span><span style="color: #008000">#Animate the Button</span><span style="color: #000000">
        </span><span style="color: #0000ff">if</span><span style="color: #000000">(</span><span style="color: #8b0000">$buttonStartJob</span><span style="color: #000000">.ImageIndex </span><span style="color: #0000ff">-lt</span><span style="color: #000000"> </span><span style="color: #8b0000">$buttonStartJob</span><span style="color: #000000">.ImageList.Images.Count </span><span style="color: #0000ff">-</span><span style="color: #000000"> </span><span style="color: #000000">1</span><span style="color: #000000">)
        {
            </span><span style="color: #8b0000">$buttonStartJob</span><span style="color: #000000">.ImageIndex </span><span style="color: #0000ff">+=</span><span style="color: #000000"> </span><span style="color: #000000">1</span><span style="color: #000000">
        }
        </span><span style="color: #0000ff">else</span><span style="color: #000000">
        {
            </span><span style="color: #8b0000">$buttonStartJob</span><span style="color: #000000">.ImageIndex </span><span style="color: #0000ff">=</span><span style="color: #000000"> </span><span style="color: #000000">0</span><span style="color: #000000">
        }
    }
}</span></pre>
<p>All of the script is now contained within a single location. What’s more we can use the Add-JobTracker function to create multiple jobs using various sources as triggers without having to create multiple timers or add any other special considerations.</p>
<p><strong></strong>&nbsp;</p>
<p><strong>Displaying Progress with the Job Tracker:</strong></p>
<p>If you want to display partial data or the Job’s progress, you should use the Receive-Job cmdlet during the update script block. </p>
<p>If you want to use a progress bar, you might consider having your job script output the percentage of progress.</p>
<p>&nbsp;<span style="color: #000000"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Job Progress" border="0" alt="Job Progress" src="http://www.sapien.com/blog/wp-content/uploads/2012/05/Job-Progress.png" width="304" height="123"></span></p>
<p>For example:</p>
<pre><span style="color: #000000">    </span><span style="color: #3399ff">-JobScript</span><span style="color: #000000"> {
        </span><span style="color: #0000ff">for</span><span style="color: #000000">(</span><span style="color: #8b0000">$i</span><span style="color: #000000"> </span><span style="color: #0000ff">=</span><span style="color: #000000"> </span><span style="color: #000000">0</span><span style="color: #000000">; </span><span style="color: #8b0000">$i</span><span style="color: #000000"> </span><span style="color: #0000ff">-lt</span><span style="color: #000000"> </span><span style="color: #000000">100</span><span style="color: #000000">; </span><span style="color: #8b0000">$i</span><span style="color: #0000ff">++</span><span style="color: #000000">)
        {
            </span><span style="color: #008000">#Do some work</span><span style="color: #000000">
            </span><span style="color: #0000ff; font-weight: bold">Start-Sleep</span><span style="color: #000000"> </span><span style="color: #3399ff">-Milliseconds</span><span style="color: #000000"> </span><span style="color: #000000">100</span><span style="color: #000000">
            </span><span style="color: #008000">#Output Progress</span><span style="color: #000000">
            </span><span style="color: #8b0000">$i</span><span style="color: #000000"> </span><span style="color: #0000ff">+</span><span style="color: #000000"> </span><span style="color: #000000">1</span><span style="color: #000000">
        }
    }</span></pre>
<p>Now you can use the Receive-Job cmdlet to check the last value and use it to set the progress bar.</p>
<pre><span style="color: #000000">    </span><span style="color: #3399ff">-UpdateScript</span><span style="color: #000000"> {
        </span><span style="color: #0000ff">Param</span><span style="color: #000000">(</span><span style="color: #8b0000">$Job</span><span style="color: #000000">)
        </span><span style="color: #8b0000">$results</span><span style="color: #000000"> </span><span style="color: #0000ff">=</span><span style="color: #000000"> </span><span style="color: #0000ff; font-weight: bold">Receive-Job</span><span style="color: #000000"> </span><span style="color: #3399ff">-Job</span><span style="color: #000000"> </span><span style="color: #8b0000">$Job</span><span style="color: #000000"> </span><span style="color: #0000ff">|</span><span style="color: #000000"> </span><span style="color: #0000ff; font-weight: bold">Select-Object</span><span style="color: #000000"> </span><span style="color: #3399ff">-Last</span><span style="color: #000000"> </span><span style="color: #000000">1</span><span style="color: #000000">

        </span><span style="color: #0000ff">if</span><span style="color: #000000">(</span><span style="color: #8b0000">$results</span><span style="color: #000000"> </span><span style="color: #0000ff">-is</span><span style="color: #000000"> [int])
        {
            </span><span style="color: #8b0000">$progressbar1</span><span style="color: #000000">.Value </span><span style="color: #0000ff">=</span><span style="color: #000000"> </span><span style="color: #8b0000">$results</span><span style="color: #000000">
        }
    }</span></pre>
<p>And update the CompleteScript scriptblock to show the progress at 100%:</p>
<pre><span style="color: #000000">    </span><span style="color: #3399ff">-CompletedScript</span><span style="color: #000000"> {
        </span><span style="color: #0000ff">Param</span><span style="color: #000000">(</span><span style="color: #8b0000">$Job</span><span style="color: #000000">)
        </span><span style="color: #8b0000">$progressbar1</span><span style="color: #000000">.Value </span><span style="color: #0000ff">=</span><span style="color: #000000"> </span><span style="color: #000000">100</span><span style="color: #000000">
        </span><span style="color: #8b0000">$buttonStartJob</span><span style="color: #000000">.Enabled </span><span style="color: #0000ff">=</span><span style="color: #000000"> </span><span style="color: #8b0000">$true</span><span style="color: #000000">
    }</span></pre>
<pre><span style="color: #000000"></span>&nbsp;</pre>
<p>If you return results as well as the progress status then you might want to use the Receive-Job’s Keep parameter to ensure the data is all there. You will also need to make sure you ignore the progress information when processing the final results. You can use any number of techniques to differentiate this information. For example, you can use strings that start with “P: ” to determine it is a progress indicator. Of course this also then means you will need to parse and filter this information when receiving job results. The sky is the limit as to how you wish to handle these situations.</p>
<p><strong></strong>&nbsp;</p>
<p><strong>Job Tracker Control Set!</strong></p>
<p>The good news is you needn’t worry about copying and pasting the framework in to each of your forms. I created an easy to use Control Set that will insert the framework into your existing form.&nbsp; In addition, I updated the “Button – Start Job” control set to utilize the new Job Tracker framework. The beauty of it is that it will no longer insert duplicate timers, since it is now handled by the Job Tracker Control Set.</p>
<p>These control sets will be available in the next service release (v3.0.4). </p>
<p>In the mean time you can download the sample <a href="http://www.sapien.com/downloads#Sample Scripts/JobProgressBar.zip">Job Progress bar</a> form from our <a href="http://downloads.sapien.com">Downloads</a> section.</p>

<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F16%2Fpowershell-studio-creating-responsive-forms%2F&amp;title=PowerShell+Studio%3A+Creating+Responsive+Forms" title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F16%2Fpowershell-studio-creating-responsive-forms%2F&amp;title=PowerShell+Studio%3A+Creating+Responsive+Forms" title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F16%2Fpowershell-studio-creating-responsive-forms%2F&amp;title=PowerShell+Studio%3A+Creating+Responsive+Forms" title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F16%2Fpowershell-studio-creating-responsive-forms%2F&amp;title=PowerShell+Studio%3A+Creating+Responsive+Forms" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F16%2Fpowershell-studio-creating-responsive-forms%2F&amp;title=PowerShell+Studio%3A+Creating+Responsive+Forms', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://images.del.icio.us/static/img/delicious.small.gif" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F16%2Fpowershell-studio-creating-responsive-forms%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F16%2Fpowershell-studio-creating-responsive-forms%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F16%2Fpowershell-studio-creating-responsive-forms%2F&amp;title=PowerShell+Studio%3A+Creating+Responsive+Forms" title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F16%2Fpowershell-studio-creating-responsive-forms%2F&amp;title=PowerShell+Studio%3A+Creating+Responsive+Forms" title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a>
</span>
<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/Button' rel='tag' target='_self'>Button</a>, <a class='technorati-link' href='http://technorati.com/tag/Control+Sets' rel='tag' target='_self'>Control Sets</a>, <a class='technorati-link' href='http://technorati.com/tag/Controls' rel='tag' target='_self'>Controls</a>, <a class='technorati-link' href='http://technorati.com/tag/Form' rel='tag' target='_self'>Form</a>, <a class='technorati-link' href='http://technorati.com/tag/job' rel='tag' target='_self'>job</a>, <a class='technorati-link' href='http://technorati.com/tag/powershell' rel='tag' target='_self'>powershell</a>, <a class='technorati-link' href='http://technorati.com/tag/PowerShell+Studio' rel='tag' target='_self'>PowerShell Studio</a>, <a class='technorati-link' href='http://technorati.com/tag/PrimalForms' rel='tag' target='_self'>PrimalForms</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://www.sapien.com/blog/2012/05/16/powershell-studio-creating-responsive-forms/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PrimalScript 2012: What&#8217;s new? (Part 8)</title>
		<link>http://www.sapien.com/blog/2012/05/14/primalscript-2012-whats-new-part-8/</link>
		<comments>http://www.sapien.com/blog/2012/05/14/primalscript-2012-whats-new-part-8/#comments</comments>
		<pubDate>Mon, 14 May 2012 17:59:48 +0000</pubDate>
		<dc:creator>Alex Riedel</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[PrimalScript]]></category>
		<category><![CDATA[Software News]]></category>
		<category><![CDATA[context]]></category>
		<category><![CDATA[ftp]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[PrimalScript 2012]]></category>
		<category><![CDATA[PrimalXML]]></category>
		<category><![CDATA[Ribbon]]></category>
		<category><![CDATA[WYSIWYG]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://www.sapien.com/blog/?p=4291</guid>
		<description><![CDATA[<br/>Last time we looked at the new code navigator on top of the source code views in PrimalScript 2012. Today we’ll have a look at the other tabs on the new ribbon interface. There are four additional tabs that are always available: View This is the place where you can show or hide all the [...]]]></description>
			<content:encoded><![CDATA[<br/><p>Last time we looked at the new code navigator on top of the source code views in PrimalScript 2012. Today we’ll have a look at the other tabs on the new ribbon interface.</p>
<p>There are four additional tabs that are always available:</p>
<h3>View</h3>
<p><a href="http://www.sapien.com/blog/wp-content/uploads/2012/05/image.png" target="_blank"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.sapien.com/blog/wp-content/uploads/2012/05/image_thumb.png" width="644" height="93"></a> </p>
<p>This is the place where you can show or hide all the secondary windows, or things you switched of by accident. Most items are pretty self-explanatory. The Debug console only applies to PowerShell, so don’t expect that to be available when&nbsp; you are debugging VBScript. ‘Call Stack’, ‘Variables’ and ‘Watch’ become visible automatically when you start debugging, but in case you inadvertently close one, here is where you bring it back.</p>
<h3>Project</h3>
<p><a href="http://www.sapien.com/blog/wp-content/uploads/2012/05/image1.png" target="_blank"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.sapien.com/blog/wp-content/uploads/2012/05/image_thumb1.png" width="644" height="115"></a> </p>
<p>If the name didn’t give it away, this tab is about projects. If you have never used them, you can just forget about this tab. If you use projects to group files together, develop ASP web sites, create C# or VB.NET components etc. you have seen all this. All the project functionality of the previous PrimalScript versions is concentrated in one place. </p>
<h3>Tools</h3>
<p><a href="http://www.sapien.com/blog/wp-content/uploads/2012/05/image2.png" target="_blank"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.sapien.com/blog/wp-content/uploads/2012/05/image_thumb2.png" width="644" height="108"></a> </p>
<p>The Tools tab is the home of all the things you should need occasionally, but please let us know if we need to transfer any of this to the Home tab. The wizards are pretty much on par with the 2011 versions and the FTP functionality is also identical. We just moved the items from the 2011 file submenu to it’s own group here to make it more discoverable.<br />The source control group contains all the items from the old Source control toolbar. Last but not least we have the Database group, which sets the current connection for any SQL files you would like to run directly from within PrimalScript.</p>
<h3>Help</h3>
<p><a href="http://www.sapien.com/blog/wp-content/uploads/2012/05/image3.png" target="_blank"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.sapien.com/blog/wp-content/uploads/2012/05/image_thumb3.png" width="393" height="148"></a> </p>
<p>Product Help links to the help file, the manual and a default keyboard map. Yes, we know it is still the 2011 manual. It is being worked on and I was promised it would go faster than last time.<br />Check for updates launches the update checker in the designated interval. As opposed to some other products, we don’t continuously run an agent hogging memory and bandwidth. The check is only run as set by you and then terminates. Of course you can always click “Check for updates” to check right now.<br />Register product: We really encourage you to do that. It will store your license key on our site and associate it with your login. If you ever loose your hard drive and email archive, you can get the license key and the software right on our site. If you don’t register your key we may not be able to help you especially if you or your company purchased it through a third party.</p>
<p>Some links to our site round out this category. Click on them, pretty self-explanatory.</p>
</p>
</p>
<p>&nbsp;</p>
<p>Additionally, there are three context tabs which only show up when you open and activate HTML or XML files. There is a third kind, which will only open up when you connect to an FTP site.<br />These are called context tabs because they only become visible when the associated document type is open and has the focus. It reduces clutter in the main user interface for those who never use these functions.</p>
<h3>HTML</h3>
<p><a href="http://www.sapien.com/blog/wp-content/uploads/2012/05/image4.png" target="_blank"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.sapien.com/blog/wp-content/uploads/2012/05/image_thumb4.png" width="644" height="114"></a> </p>
<p>Whenever you set the focus to an HTML page in text or WYSIYG mode you will see the HTML context tab show up. It contains helpful functions and indicators for this particular file type. If you open a browser window within PrimalScript, e.g. from an MSDN search, you will also get this context tab. As soon as you activate a document where this does not apply to it will be hidden again.</p>
<h3>XML</h3>
<h3><a href="http://www.sapien.com/blog/wp-content/uploads/2012/05/image5.png" target="_blank"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.sapien.com/blog/wp-content/uploads/2012/05/image_thumb5.png" width="426" height="147"></a></h3>
<p>XML are very commonly used as configuration files today and you may encounter them more often than before. PrimalScript contains a special XML editor that makes the structure of these files easier to comprehend. If you want to edit them in plain text mode, you can. If you have to deal with these types of files a lot I suggest you also have a look at <a href="http://www.sapien.com/software/primalxml" target="_blank">PrimalXML 2012</a>. This tab and its groups contain command that apply to the structured XML editor in PrimalScript.</p>
<h3>FTP</h3>
<p><a href="http://www.sapien.com/blog/wp-content/uploads/2012/05/image6.png" target="_blank"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.sapien.com/blog/wp-content/uploads/2012/05/image_thumb6.png" width="422" height="147"></a></p>
</p>
<p>We do not recommend that you edit files directly on an FTP server. It is always much better to sandbox them locally and upload them when you are done editing. We know however that what is consider a “best practice” does not always correlate to reality. So if you go to the Tools tab on the Ribbon bar and open an FTP site you will see this context tab becoming active. For PrimalScript 20xx users this is really just a reincarnation of the FTP toolbar. The functions are pretty straightforward and should pose no problem for users familiar with FTP.</p>

<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F14%2Fprimalscript-2012-whats-new-part-8%2F&amp;title=PrimalScript+2012%3A+What%26%238217%3Bs+new%3F+%28Part+8%29" title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F14%2Fprimalscript-2012-whats-new-part-8%2F&amp;title=PrimalScript+2012%3A+What%26%238217%3Bs+new%3F+%28Part+8%29" title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F14%2Fprimalscript-2012-whats-new-part-8%2F&amp;title=PrimalScript+2012%3A+What%26%238217%3Bs+new%3F+%28Part+8%29" title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F14%2Fprimalscript-2012-whats-new-part-8%2F&amp;title=PrimalScript+2012%3A+What%26%238217%3Bs+new%3F+%28Part+8%29" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F14%2Fprimalscript-2012-whats-new-part-8%2F&amp;title=PrimalScript+2012%3A+What%26%238217%3Bs+new%3F+%28Part+8%29', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://images.del.icio.us/static/img/delicious.small.gif" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F14%2Fprimalscript-2012-whats-new-part-8%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F14%2Fprimalscript-2012-whats-new-part-8%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F14%2Fprimalscript-2012-whats-new-part-8%2F&amp;title=PrimalScript+2012%3A+What%26%238217%3Bs+new%3F+%28Part+8%29" title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F14%2Fprimalscript-2012-whats-new-part-8%2F&amp;title=PrimalScript+2012%3A+What%26%238217%3Bs+new%3F+%28Part+8%29" title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a>
</span>
<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/context' rel='tag' target='_self'>context</a>, <a class='technorati-link' href='http://technorati.com/tag/ftp' rel='tag' target='_self'>ftp</a>, <a class='technorati-link' href='http://technorati.com/tag/html' rel='tag' target='_self'>html</a>, <a class='technorati-link' href='http://technorati.com/tag/PrimalScript+2012' rel='tag' target='_self'>PrimalScript 2012</a>, <a class='technorati-link' href='http://technorati.com/tag/PrimalXML' rel='tag' target='_self'>PrimalXML</a>, <a class='technorati-link' href='http://technorati.com/tag/Ribbon' rel='tag' target='_self'>Ribbon</a>, <a class='technorati-link' href='http://technorati.com/tag/WYSIWYG' rel='tag' target='_self'>WYSIWYG</a>, <a class='technorati-link' href='http://technorati.com/tag/XML' rel='tag' target='_self'>XML</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://www.sapien.com/blog/2012/05/14/primalscript-2012-whats-new-part-8/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Service Release (4/10/2012)</title>
		<link>http://www.sapien.com/blog/2012/05/10/service-release-4102012/</link>
		<comments>http://www.sapien.com/blog/2012/05/10/service-release-4102012/#comments</comments>
		<pubDate>Thu, 10 May 2012 17:09:00 +0000</pubDate>
		<dc:creator>David Corrales</dc:creator>
				<category><![CDATA[PowerShell Studio 2012]]></category>
		<category><![CDATA[PrimalForms]]></category>
		<category><![CDATA[PrimalForms 2011]]></category>
		<category><![CDATA[PrimalScript]]></category>
		<category><![CDATA[Service Build]]></category>
		<category><![CDATA[Software News]]></category>
		<category><![CDATA[2011]]></category>
		<category><![CDATA[2012]]></category>
		<category><![CDATA[ChangeVue]]></category>
		<category><![CDATA[PowerShell Studio]]></category>
		<category><![CDATA[PrimalSQL]]></category>
		<category><![CDATA[PrimalXML]]></category>

		<guid isPermaLink="false">http://www.sapien.com/blog/?p=4273</guid>
		<description><![CDATA[<br/>New versions of PrimalScript, PowerShell Studio, PrimalSQL, PrimalXML, PrimalForms and ChangeVue are available. Registered users can download the latest service builds from MySAPIEN. Release Notes: 2012 Versions: PrimalScript 2012 v6.5.125 - VBScript debugger fails on 32 bit only machines- &#8220;Search again&#8221; renamed to &#8220;Repeat last search&#8221;- Encoding displayed for embedded VBScript file in WSF- Erroneous [...]]]></description>
			<content:encoded><![CDATA[<br/><p>New versions of PrimalScript, PowerShell Studio, PrimalSQL, PrimalXML, PrimalForms and ChangeVue are available. Registered users can download the latest service builds from <a href="http://www.sapien.com/account">MySAPIEN</a>.</p>
<p><strong><font size="3">Release Notes:</font></strong></p>
<p><strong>2012 Versions:</strong></p>
<p>PrimalScript 2012 v6.5.125</p>
<p>- VBScript debugger fails on 32 bit only machines<br />- &#8220;Search again&#8221; renamed to &#8220;Repeat last search&#8221;<br />- Encoding displayed for embedded VBScript file in WSF<br />- Erroneous SaveAs dialog when closing embedded script without saving<br />- &#8220;Toggle outline&#8221; not available or functional&nbsp; on last line of region<br />- Cursor moves to a wrong place when inserting a multi-line snippet<br />- Change marker is moving with inserted empty lines<br />- Opening an embedded file shows all lines marked as changed</p>
<p>&nbsp;</p>
<p>PowerShell Studio 2012 v3.0.3</p>
<p>ADD: Pressing F1 in the Properties Pane will now take you to the appropriate MSDN help page.<br />ADD: Current Line Highlighting (Enable in Options-&gt;Editor)<br />ADD: ToolStrip Control (Toolbar Replacement)<br />ADD: Pressing Escape in the ToolBox Panel will now select the cursor.<br />ADD: Get-CheckedNodes Helper Function for TreeViews<br />ADD: Get-MSChartInstalled Helper Function for Chart<br />ADD: NotifyIcon Spotlight Article Link<br />ADD: Speech Snippet which uses .NET to produce speech.<br />ADD: Option to expand alias and partial parameter names with TAB.<br />ADD: New Control Set: ElementHost &#8211; Host WPF Controls in WinForms!<br />FIX: File Compare not calling PrimalMerge 2012<br />FIX: Signing message missing space<br />UPD: NotifyIcon Helper Function<br />UPD: MySQL Provider<br />UPD: Partial Parameters will not color unless there is a unique match<br />UPD: Control Sets will now include regions for Functions and Events<br />UPD: RSEE Service Installers</p>
<p>Previous Builds changes:<br />UPD: Sort-ListViewColum, Add-ListViewItem, Load-ListBox, Load-ComboBox helper functions<br />UPD: ListView &#8211; SortingColumns and ListView Application List ControlSets<br />FIX: Can&#8217;t refresh Cache once a module exported.<br />FIX: Splitter Exception when Closing and Opening Docking Panels<br />FIX: Crash issue when hovering over a bad parameter<br />FIX: Crash Issue when tabbing with PrimalSense List has no selection.<br />FIX: Console not restarting after typing &#8220;exit&#8221;<br />FIX: FuctionExplorer &#8211; &#8220;failed to compare two elements&#8221; error<br />FIX: Crash issue when using internal Help<br />FIX: Internal Help no longer use when typing Cmdlets in editor and &#8220;Use External Help&#8221; is set.<br />UPD: Partial Parameters will display the complete name when hovering</p>
<p>PrimalSQL 2012 v3.0.1</p>
<p>FIX: Splitter Exception when Closing and Opening Docking Panels<br />UPD: MySQL Provider</p>
<p>&nbsp;</p>
<p>PrimalXML 2012 v3.0.2</p>
<p>FIX: File Compare not calling PrimalMerge 2012</p>
<p>&nbsp;
<p>ChangeVue 2012 v2.1.44</p>
<p>- Added current version column to main file list<br />- Times and dates are now displayed according to current locale.
<p>&nbsp;
<p><strong>2011 Versions:</strong></p>
<p>PrimalScript 2011 v6.0.175</p>
<p>Minor fixes and changes</p>
<p>&nbsp;</p>
<p>PrimalForms 2011 v2.0.25</p>
<p>FIX: Splitter Exception when Closing and Opening Docking Panels<br />UPD: MySQL Provider<br />ADD: Get-CheckedNodes Helper Function for TreeView<br />ADD: Get-MSChartInstalled Helper Function for Chart<br />ADD: NotifyIcon Spotlight Article Link<br />UPD: NotifyIcon Helper Function<br />ADD: Speech Snippet which uses .NET to produce speech.<br />ADD: Option to expand aliases on a TAB press.</p>
<p>&nbsp;</p>
<p>PrimalSQL 2011 v2.0.19</p>
<p>FIX: Splitter Exception when Closing and Opening Docking Panels<br />UPD: MySQL Provider</p>

<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F10%2Fservice-release-4102012%2F&amp;title=Service+Release+%284%2F10%2F2012%29" title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F10%2Fservice-release-4102012%2F&amp;title=Service+Release+%284%2F10%2F2012%29" title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F10%2Fservice-release-4102012%2F&amp;title=Service+Release+%284%2F10%2F2012%29" title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F10%2Fservice-release-4102012%2F&amp;title=Service+Release+%284%2F10%2F2012%29" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F10%2Fservice-release-4102012%2F&amp;title=Service+Release+%284%2F10%2F2012%29', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://images.del.icio.us/static/img/delicious.small.gif" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F10%2Fservice-release-4102012%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F10%2Fservice-release-4102012%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F10%2Fservice-release-4102012%2F&amp;title=Service+Release+%284%2F10%2F2012%29" title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F10%2Fservice-release-4102012%2F&amp;title=Service+Release+%284%2F10%2F2012%29" title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a>
</span>
<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/2011' rel='tag' target='_self'>2011</a>, <a class='technorati-link' href='http://technorati.com/tag/2012' rel='tag' target='_self'>2012</a>, <a class='technorati-link' href='http://technorati.com/tag/ChangeVue' rel='tag' target='_self'>ChangeVue</a>, <a class='technorati-link' href='http://technorati.com/tag/PowerShell+Studio' rel='tag' target='_self'>PowerShell Studio</a>, <a class='technorati-link' href='http://technorati.com/tag/PrimalForms' rel='tag' target='_self'>PrimalForms</a>, <a class='technorati-link' href='http://technorati.com/tag/PrimalScript' rel='tag' target='_self'>PrimalScript</a>, <a class='technorati-link' href='http://technorati.com/tag/PrimalSQL' rel='tag' target='_self'>PrimalSQL</a>, <a class='technorati-link' href='http://technorati.com/tag/PrimalXML' rel='tag' target='_self'>PrimalXML</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://www.sapien.com/blog/2012/05/10/service-release-4102012/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PrimalScript 2012: What&#8217;s new? (Part 7)</title>
		<link>http://www.sapien.com/blog/2012/05/09/primalscript-2012-whats-new-part-7/</link>
		<comments>http://www.sapien.com/blog/2012/05/09/primalscript-2012-whats-new-part-7/#comments</comments>
		<pubDate>Wed, 09 May 2012 13:00:00 +0000</pubDate>
		<dc:creator>Alex Riedel</dc:creator>
				<category><![CDATA[PrimalScript]]></category>
		<category><![CDATA[Software News]]></category>
		<category><![CDATA[VBScript]]></category>
		<category><![CDATA[Windows PowerShell]]></category>
		<category><![CDATA[Classes]]></category>
		<category><![CDATA[Functions]]></category>
		<category><![CDATA[JScript]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[PrimalScript 2012]]></category>
		<category><![CDATA[scope]]></category>

		<guid isPermaLink="false">http://www.sapien.com/blog/?p=4138</guid>
		<description><![CDATA[<br/>Last time we told you about some new debugger features in PrimalScript 2012. And you already know all about the new Ribbon user interface this new version sports. One thing that we were really focused about in this version was to make navigating your code easier. Since there is no “PrimalSense” toolbar anymore the method [...]]]></description>
			<content:encoded><![CDATA[<br/><p>Last time we told you about some new debugger features in PrimalScript 2012. And you already know all about the new Ribbon user interface this new version sports. One thing that we were really focused about in this version was to make navigating your code easier.</p>
<p>Since there is no “PrimalSense” toolbar anymore the method combo box that enabled you to jump between functions needed to find a new home.</p>
<p>If you load a file into PrimalScript 2012 you will notice the two new combo boxes on top of the edit window:</p>
<p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="SNAGHTML1cb3599" border="0" alt="SNAGHTML1cb3599" src="http://www.sapien.com/blog/wp-content/uploads/2012/04/SNAGHTML1cb3599.png" width="492" height="215"></p>
</p>
<p>The right-hand combo box serves as an indicator for the current position as well as a quick way to jump to a specific function:</p>
<p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="SNAGHTML1cd03ff" border="0" alt="SNAGHTML1cd03ff" src="http://www.sapien.com/blog/wp-content/uploads/2012/04/SNAGHTML1cd03ff.png" width="235" height="326"></p>
<p>The left-hand box is a selector for the current scope. If you use only languages without support for classes, like PowerShell, you can skip the rest. But if you use VBScript, JScript, C# or other languages supporting classes then this is for you.</p>
<p>If you have a file with multiple classes you can select the scope on the left and then the function on the right. Just as with functions, the combo box also serves as a location indicator, so you know with just once glance <strong>which</strong> GetItem function you are currently working on.</p>
<p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="SNAGHTML1d3df40" border="0" alt="SNAGHTML1d3df40" src="http://www.sapien.com/blog/wp-content/uploads/2012/04/SNAGHTML1d3df40.png" width="428" height="181"></p>
<p>Next time we will tell you about the other tabs on the ribbon and what they do.</p>

<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F09%2Fprimalscript-2012-whats-new-part-7%2F&amp;title=PrimalScript+2012%3A+What%26%238217%3Bs+new%3F+%28Part+7%29" title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F09%2Fprimalscript-2012-whats-new-part-7%2F&amp;title=PrimalScript+2012%3A+What%26%238217%3Bs+new%3F+%28Part+7%29" title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F09%2Fprimalscript-2012-whats-new-part-7%2F&amp;title=PrimalScript+2012%3A+What%26%238217%3Bs+new%3F+%28Part+7%29" title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F09%2Fprimalscript-2012-whats-new-part-7%2F&amp;title=PrimalScript+2012%3A+What%26%238217%3Bs+new%3F+%28Part+7%29" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F09%2Fprimalscript-2012-whats-new-part-7%2F&amp;title=PrimalScript+2012%3A+What%26%238217%3Bs+new%3F+%28Part+7%29', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://images.del.icio.us/static/img/delicious.small.gif" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F09%2Fprimalscript-2012-whats-new-part-7%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F09%2Fprimalscript-2012-whats-new-part-7%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F09%2Fprimalscript-2012-whats-new-part-7%2F&amp;title=PrimalScript+2012%3A+What%26%238217%3Bs+new%3F+%28Part+7%29" title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F09%2Fprimalscript-2012-whats-new-part-7%2F&amp;title=PrimalScript+2012%3A+What%26%238217%3Bs+new%3F+%28Part+7%29" title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a>
</span>
<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/Classes' rel='tag' target='_self'>Classes</a>, <a class='technorati-link' href='http://technorati.com/tag/Functions' rel='tag' target='_self'>Functions</a>, <a class='technorati-link' href='http://technorati.com/tag/JScript' rel='tag' target='_self'>JScript</a>, <a class='technorati-link' href='http://technorati.com/tag/powershell' rel='tag' target='_self'>powershell</a>, <a class='technorati-link' href='http://technorati.com/tag/PrimalScript+2012' rel='tag' target='_self'>PrimalScript 2012</a>, <a class='technorati-link' href='http://technorati.com/tag/scope' rel='tag' target='_self'>scope</a>, <a class='technorati-link' href='http://technorati.com/tag/VBScript' rel='tag' target='_self'>VBScript</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://www.sapien.com/blog/2012/05/09/primalscript-2012-whats-new-part-7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Spotlight on the NotifyIcon Control</title>
		<link>http://www.sapien.com/blog/2012/05/08/spotlight-on-the-notifyicon-control/</link>
		<comments>http://www.sapien.com/blog/2012/05/08/spotlight-on-the-notifyicon-control/#comments</comments>
		<pubDate>Tue, 08 May 2012 22:24:00 +0000</pubDate>
		<dc:creator>David Corrales</dc:creator>
				<category><![CDATA[PowerShell Studio 2012]]></category>
		<category><![CDATA[PrimalForms]]></category>
		<category><![CDATA[PrimalForms 2011]]></category>
		<category><![CDATA[Spotlight on Controls]]></category>
		<category><![CDATA[Windows PowerShell]]></category>
		<category><![CDATA[Controls]]></category>
		<category><![CDATA[NotifyIcon]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[WinForm]]></category>

		<guid isPermaLink="false">http://www.sapien.com/blog/?p=4114</guid>
		<description><![CDATA[<br/>The “Spotlight on Controls” series focuses on a single WinForms control in PowerShell Studio 2012, details the important Properties, Methods, and Events of the control and demonstrates how to utilize the control. Most of the information about the controls is still applicable to previous versions of PrimalForms. Last time we took a look at the [...]]]></description>
			<content:encoded><![CDATA[<br/><p><em>The “Spotlight on Controls” series focuses on a single WinForms control in PowerShell Studio 2012, details the important Properties, Methods, and Events of the control and demonstrates how to utilize the control. Most of the information about the controls is still applicable to previous versions of PrimalForms.</em></p>
<p>Last time we took a look at the ListView control. This time we will look at the NotifyIcon control:</p>
<p><span style="font-size: medium"><strong>NotifyIcon </strong>[System.Windows.Forms.NotifyIcon]</span></p>
<p>Specifies a component that creates an icon in the notification area of the Window’s taskbar. </p>
<p><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="NotifyIcon" border="0" alt="NotifyIcon" src="http://www.sapien.com/blog/wp-content/uploads/2012/04/NotifyIcon.png" width="134" height="22"></p>
<p>Default Event: MouseDoubleClick</p>
<p><em>Why use a NotifyIcon control?</em></p>
<p>Use the NotifyIcon control, to alert users of special events, such as when a task is completed. Typically this control is used for informational purposes, but it can also be used as a source for user interaction.</p>
<p>Note: When you add a NotifyIcon it will appear at the bottom of the Designer:</p>
<p><a href="http://www.sapien.com/blog/wp-content/uploads/2012/04/NotifyIcon-in-Designer.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="NotifyIcon in Designer" border="0" alt="NotifyIcon in Designer" src="http://www.sapien.com/blog/wp-content/uploads/2012/04/NotifyIcon-in-Designer_thumb.png" width="244" height="152"></a></p>
<p>&nbsp;</p>
<p><strong><font size="3">Important Properties:</font></strong></p>
<p><strong>BalloonTipText</strong></p>
<p>This property sets the text associated with the balloon ToolTip. Use this property to display a message in the Balloon Tooltip.</p>
<p>Setting the BalloonTipText in the script editor:</p>
<pre><span style="color: #8b0000">$NotifyIcon</span><span style="color: #000000">.BalloonTipText </span><span style="color: #0000ff">=</span><span style="color: #000000"> </span><span style="color: #ff0000">"This is the balloon text"</span></pre>
<p><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="BalloonText" border="0" alt="BalloonText" src="http://www.sapien.com/blog/wp-content/uploads/2012/04/BalloonText.png" width="153" height="64"></p>
<p><strong>BalloonTipTitle</strong></p>
<p>This property sets the title of the balloon ToolTip.<br />The title text is displayed above the balloon text.</p>
<p><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Balloon Title" border="0" alt="Balloon Title" src="http://www.sapien.com/blog/wp-content/uploads/2012/04/Balloon-Title.png" width="152" height="92"></p>
<p><strong>BalloonTipIcon</strong></p>
<p>This property sets the icon to associate with the balloon Tooltip. In other words, the icon displayed inside the tooltip itself. <br />Note: The <em>BalloonTipTitle</em> property must be set in order to view the balloon icon.</p>
<p>Values (Default: <em>None</em>):</p>
<blockquote>
<p><em>None<br /></em>No icon is displayed.<br /><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Icon None" border="0" alt="Icon None" src="http://www.sapien.com/blog/wp-content/uploads/2012/04/Icon-None.png" width="147" height="96"></p>
<p><em>Info</em><br />An information icon.<br /><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Icon Info" border="0" alt="Icon Info" src="http://www.sapien.com/blog/wp-content/uploads/2012/04/Icon-Info.png" width="153" height="95"></p>
<p><em>Warning</em><br />A warning icon.<br /><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Icon Warning" border="0" alt="Icon Warning" src="http://www.sapien.com/blog/wp-content/uploads/2012/04/Icon-Warning.png" width="186" height="95"></p>
<p><em>Error</em><br />An error icon.<br /><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Icon Error" border="0" alt="Icon Error" src="http://www.sapien.com/blog/wp-content/uploads/2012/04/Icon-Error.png" width="164" height="95"></p>
</blockquote>
<p><strong>Icon</strong></p>
<p>This property sets the icon to display in the system tray. </p>
<p><font color="#ff0000">Important: This property must be set; otherwise the tooltip balloon will not show!</font></p>
<p>The designer will allow you to browse and select an icon to display when the tooltip is shown.</p>
<p>Click on the browse button in the Property Panel:</p>
<p><a href="http://www.sapien.com/blog/wp-content/uploads/2012/04/Icon-Property-in-the-PropertyPanel.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Icon Property in the PropertyPanel" border="0" alt="Icon Property in the PropertyPanel" src="http://www.sapien.com/blog/wp-content/uploads/2012/04/Icon-Property-in-the-PropertyPanel_thumb.png" width="244" height="84"></a></p>
<p>Or use the menu in the designer:</p>
<p><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Choose Icon Designer" border="0" alt="Choose Icon Designer" src="http://www.sapien.com/blog/wp-content/uploads/2012/04/Choose-Icon-Designer.png" width="263" height="84"></p>
<p>Next select the Icon file</p>
<p><a href="http://www.sapien.com/blog/wp-content/uploads/2012/04/Open-Icon-File-Dialog.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Open Icon File Dialog" border="0" alt="Open Icon File Dialog" src="http://www.sapien.com/blog/wp-content/uploads/2012/04/Open-Icon-File-Dialog_thumb.png" width="244" height="164"></a></p>
<p>Finally the Icon will be displayed in the system tray:</p>
<p><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Icon in System Tray" border="0" alt="Icon in System Tray" src="http://www.sapien.com/blog/wp-content/uploads/2012/04/Icon-in-System-Tray.png" width="146" height="34"></p>
<p>Note: If a “phantom” icon remains in the system tray after closing the form, then it is recommended set the Visible property to <em>False</em> in order to clear the icon before closing form.</p>
<p><strong>ContextMenuStrip</strong></p>
<p>This property sets the shortcut menu to show when the user right-clicks the icon. <br />Set this property to an existing ContextMenuStrip in order to assign a menu to the system tray icon. See <a href="http://www.sapien.com/blog/2011/12/16/primalforms-2011-spotlight-on-the-contextmenustrip-control/">Spotlight on the ContextMenuStrip Control</a> for more details.</p>
<p><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="NotifyIcon's ContextMenuStrip" border="0" alt="NotifyIcon's ContextMenuStrip" src="http://www.sapien.com/blog/wp-content/uploads/2012/04/NotifyIcons-ContextMenuStrip.png" width="190" height="38"></p>
<p><strong>Visible</strong></p>
<p>This property indicates whether the icon is visible in the notification area of the taskbar.</p>
<p>Values (Default: <em>True</em>):</p>
<blockquote>
<p><em>True / False</em></p>
</blockquote>
<p><strong><font size="3">Important Events:</font></strong></p>
<p><strong>BalloonTipClicked</strong></p>
<p>This event occurs when the balloon tip is clicked. Use this event to react to user clicks in the ToolTip balloon.</p>
<pre><span style="color: #8b0000">$notifyicon1_BalloonTipClicked</span><span style="color: #0000ff">=</span><span style="color: #000000">{
    </span><span style="color: #0000ff; font-weight: bold">Write-Host</span><span style="color: #000000"> </span><span style="color: #ff0000">'The Balloon Tip was Clicked'</span><span style="color: #000000">
}</span></pre>
<p><strong><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="BalloonTip Click" border="0" alt="BalloonTip Click" src="http://www.sapien.com/blog/wp-content/uploads/2012/04/BalloonTip-Click.png" width="180" height="94"></strong></p>
<p><strong></strong>&nbsp;</p>
<p><strong>Clicked </strong><strong>&amp; DoubleClicked</strong></p>
<p>These events occur when the system tray icon is clicked. If you need more information such as which mouse button was used, then it is recommended to use the MouseClick events (See below).</p>
<p><strong>MouseClick</strong></p>
<p>This event occurs when a user clicks on the system tray icon.</p>
<p><strong>[System.Windows.Forms.LabelEditEventHandler]</strong></p>
<table border="1" cellspacing="0" cellpadding="2" width="452">
<tbody>
<tr>
<td valign="top" width="80"><strong>Properties</strong></td>
<td valign="top" width="370"><strong>Description</strong></td>
</tr>
<tr>
<td valign="top" width="80">Button</td>
<td valign="top" width="370">Gets which mouse button was pressed.</td>
</tr>
<tr>
<td valign="top" width="80">Clicks</td>
<td valign="top" width="370">Gets the number of times the mouse button was pressed and released.</td>
</tr>
<tr>
<td valign="top" width="80">Delta</td>
<td valign="top" width="370">(Not applicable)</td>
</tr>
<tr>
<td valign="top" width="80">Location</td>
<td valign="top" width="370">Gets the location of the mouse during the generating mouse event.</td>
</tr>
<tr>
<td valign="top" width="80">X</td>
<td valign="top" width="370">Gets the x-coordinate of the mouse during the generating mouse event.</td>
</tr>
<tr>
<td valign="top" width="80">Y</td>
<td valign="top" width="370">Gets the y-coordinate of the mouse during the generating mouse event.</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p>
<pre><span style="color: #8b0000">$notifyicon1_MouseClick</span><span style="color: #0000ff">=</span><span style="color: #000000">[System.Windows.Forms.MouseEventHandler]{
</span><span style="color: #008000">#Event Argument: $_ = [System.Windows.Forms.MouseEventArgs]</span><span style="color: #000000">
    </span><span style="color: #0000ff; font-weight: bold">Write-Host</span><span style="color: #000000"> </span><span style="color: #ff0000">"System Tray Icon Mouse Click: $($_.Button) Clicks: $($_.Clicks)"</span><span style="color: #000000">
}</span></pre>
<p><strong>MouseDoubleClick</strong> </p>
<p>These events occur when a user double clicks on a system tray icon. This event has the same arguments as the MouseClick event.</p>
<pre><span style="color: #8b0000">$notifyicon1_MouseDoubleClick</span><span style="color: #0000ff">=</span><span style="color: #000000">[System.Windows.Forms.MouseEventHandler]{
</span><span style="color: #008000">#Event Argument: $_ = [System.Windows.Forms.MouseEventArgs]</span><span style="color: #000000">
    </span><span style="color: #0000ff; font-weight: bold">Write-Host</span><span style="color: #000000"> </span><span style="color: #ff0000">"System Tray Icon Mouse Double Click: $($_.Button) Clicks: $($_.Clicks)"</span><span style="color: #000000">
}</span></pre>
<p><strong><font size="3">Important Methods:</font></strong></p>
<p><strong>ShowBalloonTip</strong></p>
<p>This method displays a balloon tip in the taskbar for the specified time period.</p>
<p>&nbsp;</p>
<p><span style="font-size: x-small"><font size="2"><span style="color: #0000ff">[void]</span> <span style="color: #4bacc6">ShowBalloonTip</span>(<span style="color: #0000ff">[</span><span style="color: #0000ff">int] </span><span style="color: #333333">timeout</span>)</font></span></p>
<p>Note: The method uses the properties of the NotifyIcon to display the balloon tip. Therefore they must be set before calling this method.<span style="font-size: x-small"><font size="2"></p>
<p></font></span>
<pre><span style="color: #8b0000">$NotifyIcon</span><span style="color: #000000">.ShowBalloonTip(</span><span style="color: #000000">0</span><span style="color: #000000">)</span></pre>
<pre><span style="color: #000000"></span>&nbsp;</pre>
<p><span style="font-size: x-small"><font size="2"><span style="color: #0000ff">[void]</span> <span style="color: #4bacc6">ShowBalloonTip</span>(<span style="color: #0000ff">[</span><span style="color: #0000ff">int] </span><span style="color: #333333">timeout, <span style="color: #0000ff">[</span><span style="color: #0000ff">string] </span><span style="color: #333333">tipTitle, <span style="color: #0000ff">[</span><span style="color: #0000ff"><span style="color: #0000ff">string</span>] </span><span style="color: #333333">tipText, <span style="color: #0000ff">[</span><span style="color: #0000ff">ToolTipIcon] </span>tipIcon</span></span></span>)</font></span></p>
<p>Note: This variation, displays a balloon tip with the specified title, text, and icon in the taskbar for the specified time period. You need not set the NotifyIcon’s properties if you use this method variation.</p>
<pre><span style="color: #8b0000">$NotifyIcon</span><span style="color: #000000">.ShowBalloonTip(</span><span style="color: #8b0000">$Timeout</span><span style="color: #000000">, </span><span style="color: #8b0000">$BalloonTipTitle</span><span style="color: #000000">, </span><span style="color: #8b0000">$BalloonTipText</span><span style="color: #000000">, </span><span style="color: #8b0000">$BalloonTipIcon</span><span style="color: #000000">)</span></pre>
<p><strong><font size="3"></font></strong>&nbsp;</p>
<p><strong><font size="3">Helper Function:</font></strong></p>
<p>The following is a helper function that allows you to display the NotifyIcon. The help function also assigns the calling executable’s icon, if the NotifyIcon’s Icon property hasn’t been assigned.</p>
<pre><span style="color: #0000ff">function</span><span style="color: #000000"> </span><span style="color: #008080">Show-NotifyIcon</span><span style="color: #000000">
{
</span><span style="color: #008000">&lt;#
    .SYNOPSIS
        Displays a NotifyIcon's balloon tip message in the taskbar's notification area.

    .DESCRIPTION
        Displays a NotifyIcon's a balloon tip message in the taskbar's notification area.

    .PARAMETER NotifyIcon
         The NotifyIcon control that will be displayed.

    .PARAMETER BalloonTipText
         Sets the text to display in the balloon tip.

    .PARAMETER BalloonTipTitle
        Sets the Title to display in the balloon tip.

    .PARAMETER BalloonTipIcon
        The icon to display in the ballon tip.

    .PARAMETER Timeout
        The time the ToolTip Balloon will remain visible in milliseconds.
        Default: 0 - Uses windows default.
#&gt;</span><span style="color: #000000">
     </span><span style="color: #0000ff">param</span><span style="color: #000000">(
      [Parameter(Mandatory </span><span style="color: #0000ff">=</span><span style="color: #000000"> </span><span style="color: #8b0000">$true</span><span style="color: #000000">, Position </span><span style="color: #0000ff">=</span><span style="color: #000000"> </span><span style="color: #000000">0</span><span style="color: #000000">)]
      [ValidateNotNull()]
      [System.Windows.Forms.NotifyIcon]</span><span style="color: #8b0000">$NotifyIcon</span><span style="color: #000000">,
      [Parameter(Mandatory </span><span style="color: #0000ff">=</span><span style="color: #000000"> </span><span style="color: #8b0000">$true</span><span style="color: #000000">, Position </span><span style="color: #0000ff">=</span><span style="color: #000000"> </span><span style="color: #000000">1</span><span style="color: #000000">)]
      [ValidateNotNullOrEmpty()]
      [String]</span><span style="color: #8b0000">$BalloonTipText</span><span style="color: #000000">,
      [Parameter(Position </span><span style="color: #0000ff">=</span><span style="color: #000000"> </span><span style="color: #000000">2</span><span style="color: #000000">)]
      [String]</span><span style="color: #8b0000">$BalloonTipTitle</span><span style="color: #000000"> </span><span style="color: #0000ff">=</span><span style="color: #000000"> </span><span style="color: #ff0000">''</span><span style="color: #000000">,
      [Parameter(Position </span><span style="color: #0000ff">=</span><span style="color: #000000"> </span><span style="color: #000000">3</span><span style="color: #000000">)]
      [System.Windows.Forms.ToolTipIcon]</span><span style="color: #8b0000">$BalloonTipIcon</span><span style="color: #000000"> </span><span style="color: #0000ff">=</span><span style="color: #000000"> </span><span style="color: #ff0000">'None'</span><span style="color: #000000">,
      [Parameter(Position </span><span style="color: #0000ff">=</span><span style="color: #000000"> </span><span style="color: #000000">4</span><span style="color: #000000">)]
      [int]</span><span style="color: #8b0000">$Timeout</span><span style="color: #000000"> </span><span style="color: #0000ff">=</span><span style="color: #000000"> </span><span style="color: #000000">0</span><span style="color: #000000">
     )

    </span><span style="color: #0000ff">if</span><span style="color: #000000">(</span><span style="color: #8b0000">$NotifyIcon</span><span style="color: #000000">.Icon </span><span style="color: #0000ff">-eq</span><span style="color: #000000"> </span><span style="color: #8b0000">$null</span><span style="color: #000000">)
    {
        </span><span style="color: #008000">#Set a Default Icon otherwise the balloon will not show</span><span style="color: #000000">
        </span><span style="color: #8b0000">$NotifyIcon</span><span style="color: #000000">.Icon </span><span style="color: #0000ff">=</span><span style="color: #000000"> [System.Drawing.Icon]</span><span style="color: #0000ff">::</span><span style="color: #000000">ExtractAssociatedIcon([System.Windows.Forms.Application]</span><span style="color: #0000ff">::</span><span style="color: #000000">ExecutablePath)
    }

    </span><span style="color: #8b0000">$NotifyIcon</span><span style="color: #000000">.ShowBalloonTip(</span><span style="color: #8b0000">$Timeout</span><span style="color: #000000">, </span><span style="color: #8b0000">$BalloonTipTitle</span><span style="color: #000000">, </span><span style="color: #8b0000">$BalloonTipText</span><span style="color: #000000">, </span><span style="color: #8b0000">$BalloonTipIcon</span><span style="color: #000000">)
}</span></pre>
<p>Example Use:</p>
<pre><span style="color: #008080">Show-NotifyIcon</span><span style="color: #000000"> </span><span style="color: #3399ff">-NotifyIcon</span><span style="color: #000000"> </span><span style="color: #8b0000">$notifyicon1</span><span style="color: #000000"> </span><span style="color: #3399ff">-BalloonTipText</span><span style="color: #000000"> </span><span style="color: #8b0000">$textboxText</span><span style="color: #000000">.Text `</span><span style="color: #000000">
</span><span style="color: #000000"> </span><span style="color: #3399ff">-BalloonTipTitle</span><span style="color: #000000"> </span><span style="color: #8b0000">$textboxTitle</span><span style="color: #000000">.Text <span style="color: #3399ff">-BalloonTipIcon</span><span style="color: #000000"> </span><span style="color: #8b0000">$combobox1</span><span style="color: #000000">.SelectedItem</span></span></pre>
<p>&nbsp;</p>
<p>You can download the <a href="http://www.sapien.com/downloads#Sample Scripts/PrimalForms 2011/NotifyIconSample.zip">NotifyIcon Sample</a> from our <a href="http://www.sapien.com/downloads">Downloads</a> section.</p>

<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F08%2Fspotlight-on-the-notifyicon-control%2F&amp;title=Spotlight+on+the+NotifyIcon+Control" title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F08%2Fspotlight-on-the-notifyicon-control%2F&amp;title=Spotlight+on+the+NotifyIcon+Control" title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F08%2Fspotlight-on-the-notifyicon-control%2F&amp;title=Spotlight+on+the+NotifyIcon+Control" title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F08%2Fspotlight-on-the-notifyicon-control%2F&amp;title=Spotlight+on+the+NotifyIcon+Control" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F08%2Fspotlight-on-the-notifyicon-control%2F&amp;title=Spotlight+on+the+NotifyIcon+Control', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://images.del.icio.us/static/img/delicious.small.gif" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F08%2Fspotlight-on-the-notifyicon-control%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F08%2Fspotlight-on-the-notifyicon-control%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F08%2Fspotlight-on-the-notifyicon-control%2F&amp;title=Spotlight+on+the+NotifyIcon+Control" title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F08%2Fspotlight-on-the-notifyicon-control%2F&amp;title=Spotlight+on+the+NotifyIcon+Control" title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a>
</span>
<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/Controls' rel='tag' target='_self'>Controls</a>, <a class='technorati-link' href='http://technorati.com/tag/NotifyIcon' rel='tag' target='_self'>NotifyIcon</a>, <a class='technorati-link' href='http://technorati.com/tag/powershell' rel='tag' target='_self'>powershell</a>, <a class='technorati-link' href='http://technorati.com/tag/PrimalForms+2011' rel='tag' target='_self'>PrimalForms 2011</a>, <a class='technorati-link' href='http://technorati.com/tag/WinForm' rel='tag' target='_self'>WinForm</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://www.sapien.com/blog/2012/05/08/spotlight-on-the-notifyicon-control/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PrimalScript 2012: What&#8217;s new? (Part 6)</title>
		<link>http://www.sapien.com/blog/2012/05/07/primalscript-2012-whats-new-part-6/</link>
		<comments>http://www.sapien.com/blog/2012/05/07/primalscript-2012-whats-new-part-6/#comments</comments>
		<pubDate>Mon, 07 May 2012 13:00:00 +0000</pubDate>
		<dc:creator>Alex Riedel</dc:creator>
				<category><![CDATA[PrimalScript]]></category>
		<category><![CDATA[Software News]]></category>
		<category><![CDATA[VBScript]]></category>
		<category><![CDATA[Windows PowerShell]]></category>
		<category><![CDATA[Debugger]]></category>
		<category><![CDATA[JScript]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[PrimalScript 2012]]></category>
		<category><![CDATA[Trace]]></category>

		<guid isPermaLink="false">http://www.sapien.com/blog/?p=3898</guid>
		<description><![CDATA[<br/>VBScript users have told me on occasion that they are really jealous of one feature of PowerShell: Write-Debug Depending on the value of $DebugPreference this produces output when needed but makes it easy to silence diagnostic output once a script moves to production. VBScript and JScript developers have to sprinkle WScript.Echo calls through their code [...]]]></description>
			<content:encoded><![CDATA[<br/><p>VBScript users have told me on occasion that they are really jealous of one feature of PowerShell: Write-Debug</p>
<p>Depending on the value of $DebugPreference this produces output when needed but makes it easy to silence diagnostic output once a script moves to production.</p>
<p>VBScript and JScript developers have to sprinkle WScript.Echo calls through their code and then go and comment them out before handing the script off. In a large script with hundreds or even thousands of lines that can be a daunting and error prone task. You don&#8217;t want to disable real output and not forget any diagnostic output.</p>
<p>In PrimalScript 2012 VBScript and JScript users get help with that. Take a look at the following code:</p>
<p><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.sapien.com/blog/wp-content/uploads/2012/03/image34.png" width="614" height="159"></p>
<p>&nbsp;</p>
<p>The &#8216;TRACE comments are completely harmless and inactive if you just run the script. Execute that script in PrimalScript 2012&#8242;s debugger though and the output goes to the Debug pane. Think of it as a WScript.Debug.<br />You can use the same syntax and expressions you would normally use in a WScript.Echo call.</p>
<p><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.sapien.com/blog/wp-content/uploads/2012/03/image35.png" width="405" height="157"></p>
<p>If you have to diagnose why the output from a SQL query fails after a few hundred records you certainly don&#8217;t want to sit there and single step through this or hit a breakpoint in each loop iteration. Add a TRACE statement to output unique field and when the script stops you see the last output and can easily take it from there.</p>
<p>Those of you paying attention have also already spotted the blue dot in the first screenshot and correlated it with the Tracepoint output in the second screenshot.</p>
<p>Tracepoints can be set and removed using Ctrl+F9 and are just as persistent as breakpoints if the file resides on an NTFS partition. So what are they for?</p>
<p>If you have a long running script and you are testing it you need some feedback if the script is actually moving along or is hanging somewhere. You can of course add a trace statement or a write-debug in PowerShell, but why type if you just need confirmation that your script is whizzing by a certain milestone. Adding a tracepoint is a single key combination and doesn&#8217;t affect your code at all. Obviously these are only active when your script runs in PrimalScript 2012&#8242;s debugger. They are available for VBScript, JScript and Windows PowerShell.</p>
<p>Next time we take a look at some new code navigation tools in PrimalScript 2012.</p>

<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F07%2Fprimalscript-2012-whats-new-part-6%2F&amp;title=PrimalScript+2012%3A+What%26%238217%3Bs+new%3F+%28Part+6%29" title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F07%2Fprimalscript-2012-whats-new-part-6%2F&amp;title=PrimalScript+2012%3A+What%26%238217%3Bs+new%3F+%28Part+6%29" title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F07%2Fprimalscript-2012-whats-new-part-6%2F&amp;title=PrimalScript+2012%3A+What%26%238217%3Bs+new%3F+%28Part+6%29" title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F07%2Fprimalscript-2012-whats-new-part-6%2F&amp;title=PrimalScript+2012%3A+What%26%238217%3Bs+new%3F+%28Part+6%29" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F07%2Fprimalscript-2012-whats-new-part-6%2F&amp;title=PrimalScript+2012%3A+What%26%238217%3Bs+new%3F+%28Part+6%29', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://images.del.icio.us/static/img/delicious.small.gif" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F07%2Fprimalscript-2012-whats-new-part-6%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F07%2Fprimalscript-2012-whats-new-part-6%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F07%2Fprimalscript-2012-whats-new-part-6%2F&amp;title=PrimalScript+2012%3A+What%26%238217%3Bs+new%3F+%28Part+6%29" title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F07%2Fprimalscript-2012-whats-new-part-6%2F&amp;title=PrimalScript+2012%3A+What%26%238217%3Bs+new%3F+%28Part+6%29" title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a>
</span>
<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/Debugger' rel='tag' target='_self'>Debugger</a>, <a class='technorati-link' href='http://technorati.com/tag/JScript' rel='tag' target='_self'>JScript</a>, <a class='technorati-link' href='http://technorati.com/tag/powershell' rel='tag' target='_self'>powershell</a>, <a class='technorati-link' href='http://technorati.com/tag/PrimalScript+2012' rel='tag' target='_self'>PrimalScript 2012</a>, <a class='technorati-link' href='http://technorati.com/tag/Trace' rel='tag' target='_self'>Trace</a>, <a class='technorati-link' href='http://technorati.com/tag/VBScript' rel='tag' target='_self'>VBScript</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://www.sapien.com/blog/2012/05/07/primalscript-2012-whats-new-part-6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PowerShell Studio 2012: What&#8217;s New? (Part 5)</title>
		<link>http://www.sapien.com/blog/2012/05/03/powershell-studio-2012-whats-new-part-5/</link>
		<comments>http://www.sapien.com/blog/2012/05/03/powershell-studio-2012-whats-new-part-5/#comments</comments>
		<pubDate>Thu, 03 May 2012 16:09:00 +0000</pubDate>
		<dc:creator>David Corrales</dc:creator>
				<category><![CDATA[PowerShell Studio 2012]]></category>
		<category><![CDATA[PrimalForms]]></category>
		<category><![CDATA[Software News]]></category>
		<category><![CDATA[Windows PowerShell]]></category>
		<category><![CDATA[2012]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[PowerShell Studio]]></category>
		<category><![CDATA[what's new what's changed]]></category>

		<guid isPermaLink="false">http://www.sapien.com/blog/?p=4068</guid>
		<description><![CDATA[<br/>Last time we looked at the new script editor features. Now we will take a look at the new Function Explorer as well as other additions. Function Explorer The new Function Explorer displays a list of all the functions and events within the current script file: If you are working within a Project, the available [...]]]></description>
			<content:encoded><![CDATA[<br/><p>Last time we looked at the new script editor features. Now we will take a look at the new Function Explorer as well as other additions.</p>
<p><strong><span style="font-size: small"><span style="font-size: small"><font size="3">Function Explorer</font></span></span></strong></p>
<p>The new Function Explorer displays a list of all the functions and events within the current script file:</p>
<p><a href="http://www.sapien.com/blog/wp-content/uploads/2012/04/Function-Explorer.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Function Explorer" border="0" alt="Function Explorer" src="http://www.sapien.com/blog/wp-content/uploads/2012/04/Function-Explorer_thumb.png" width="179" height="244"></a></p>
<p>If you are working within a Project, the available functions declared in other files will also be displayed.</p>
<p><strong>Navigating with the Function Explorer:</strong></p>
<p>Just by a simple double click on the function or event, it will take you directly to the declaration of the function. This becomes invaluable when dealing with scripts with a large number of functions.</p>
<p><strong>Function Explorer Context Menu:</strong></p>
<p><a href="http://www.sapien.com/blog/wp-content/uploads/2012/04/Function-Explorer-Context-Menu.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Function Explorer Context Menu" border="0" alt="Function Explorer Context Menu" src="http://www.sapien.com/blog/wp-content/uploads/2012/04/Function-Explorer-Context-Menu_thumb.png" width="244" height="173"></a></p>
<p>The context menu allows to do the following:</p>
<blockquote><p><em>Go to Declaration</em><br />Goes to the function’s declaration (same as double clicking on the function name). If the function is in another project file, then it will navigate to that file.</p>
<p><em>Insert</em><br />Inserts a call to the function.</p>
</blockquote>
<blockquote><p><em>Copy</em><br />Copies the whole function definition to the clipboard.</p>
<p><em>Rename</em><br />Renames the function including all references to the function. Within Projects, it will also update references made to the function by other project files. If you rename an event, all the controls that reference the event will also be updated. As you can see this can be a big time saver when dealing with larger scripts.</p>
<p>Before Function Renaming:</p>
<p><a href="http://www.sapien.com/blog/wp-content/uploads/2012/04/Before-Function-Rename.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Before Function Rename" border="0" alt="Before Function Rename" src="http://www.sapien.com/blog/wp-content/uploads/2012/04/Before-Function-Rename_thumb.png" width="244" height="191"></a></p>
<p>After Function Renaming:</p>
<p><a href="http://www.sapien.com/blog/wp-content/uploads/2012/04/After-Function-Rename.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="After Function Rename" border="0" alt="After Function Rename" src="http://www.sapien.com/blog/wp-content/uploads/2012/04/After-Function-Rename_thumb.png" width="244" height="188"></a></p>
</blockquote>
<p>&nbsp;</p>
<p><strong><span style="font-size: small"><span style="font-size: small"><font size="3">Other Additions and Changes:</font></span></span></strong></p>
<p>PowerShell Studio offers many other performance improvement and other numerous minor additions, changes, and keyboard shortcuts that are not listed here. The following is some more prominent miscellaneous additions you will find:</p>
<p><strong>Enhanced Console Input Line</strong></p>
<p>The console now has an enhanced input line that offers the same PrimalSense support as the script editor. You have the option to enable or disable this feature.</p>
<p><a href="http://www.sapien.com/blog/wp-content/uploads/2012/04/Console-Input-Line.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Console Input Line" border="0" alt="Console Input Line" src="http://www.sapien.com/blog/wp-content/uploads/2012/04/Console-Input-Line_thumb.png" width="244" height="102"></a></p>
<p>&nbsp;</p>
<p><strong>Project File Renaming:</strong></p>
<p>When renaming project files, reference functions will be updated accordingly through out the project files.</p>
<p>Before Project File Renaming:</p>
<p><a href="http://www.sapien.com/blog/wp-content/uploads/2012/04/Before-Project-File-Rename1.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Before Project File Rename" border="0" alt="Before Project File Rename" src="http://www.sapien.com/blog/wp-content/uploads/2012/04/Before-Project-File-Rename_thumb1.png" width="244" height="116"></a></p>
<p>After Project File Renaming:</p>
<p><a href="http://www.sapien.com/blog/wp-content/uploads/2012/04/After-Project-File-Rename.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="After Project File Rename" border="0" alt="After Project File Rename" src="http://www.sapien.com/blog/wp-content/uploads/2012/04/After-Project-File-Rename_thumb.png" width="244" height="127"></a></p>
<p>&nbsp;</p>
<p><strong>Explicit Support For PowerShell Remoting:</strong></p>
<p>PowerShell Studio now has explicit support for PowerShell Remoting. Use the “Run Remotely” option under the Run Menu:</p>
<p><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Run Remotely Option" border="0" alt="Run Remotely Option" src="http://www.sapien.com/blog/wp-content/uploads/2012/04/Run-Remotely-Option.png" width="303" height="239"></p>
<p>Next you will be presented with a dialog to enter the remote credentials:</p>
<p><a href="http://www.sapien.com/blog/wp-content/uploads/2012/04/Remote-Credentials.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Remote Credentials" border="0" alt="Remote Credentials" src="http://www.sapien.com/blog/wp-content/uploads/2012/04/Remote-Credentials_thumb.png" width="244" height="107"></a></p>
<p>And finally the script will run on the remote computer. </p>
<p>Note: This feature requires that remoting be enabled on the target system.</p>
<p>&nbsp;</p>
<p><strong>Remote Debugging:</strong></p>
<p>PowerShell Studio 2012 also supports Remote Debugging. This feature will be discussed in a separate article.</p>
<p>&nbsp;</p>
<p><strong></strong></p>
<p><strong>Tracepoints:</strong></p>
<p>Just like PrimalScript 2012, PowerShell Studio added support for trace points. See the <a href="http://www.sapien.com/blog/?s=PrimalScript+2012%3A+What%27s+New%3F">PrimalScript 2012: What’s New?</a> articles for more details.</p>
<p><a href="http://www.sapien.com/blog/wp-content/uploads/2012/05/Tracepoints.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="Tracepoints" border="0" alt="Tracepoints" src="http://www.sapien.com/blog/wp-content/uploads/2012/05/Tracepoints_thumb.png" width="244" height="153"></a></p>
<p>&nbsp;</p>
<p>All in all, you will find that SAPIEN PowerShell Studio 2012 is a major improvement over its predecessor.</p>

<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F03%2Fpowershell-studio-2012-whats-new-part-5%2F&amp;title=PowerShell+Studio+2012%3A+What%26rsquo%3Bs+New%3F+%28Part+5%29" title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F03%2Fpowershell-studio-2012-whats-new-part-5%2F&amp;title=PowerShell+Studio+2012%3A+What%26rsquo%3Bs+New%3F+%28Part+5%29" title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F03%2Fpowershell-studio-2012-whats-new-part-5%2F&amp;title=PowerShell+Studio+2012%3A+What%26rsquo%3Bs+New%3F+%28Part+5%29" title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F03%2Fpowershell-studio-2012-whats-new-part-5%2F&amp;title=PowerShell+Studio+2012%3A+What%26rsquo%3Bs+New%3F+%28Part+5%29" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F03%2Fpowershell-studio-2012-whats-new-part-5%2F&amp;title=PowerShell+Studio+2012%3A+What%26rsquo%3Bs+New%3F+%28Part+5%29', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://images.del.icio.us/static/img/delicious.small.gif" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F03%2Fpowershell-studio-2012-whats-new-part-5%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F03%2Fpowershell-studio-2012-whats-new-part-5%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F03%2Fpowershell-studio-2012-whats-new-part-5%2F&amp;title=PowerShell+Studio+2012%3A+What%26rsquo%3Bs+New%3F+%28Part+5%29" title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F03%2Fpowershell-studio-2012-whats-new-part-5%2F&amp;title=PowerShell+Studio+2012%3A+What%26rsquo%3Bs+New%3F+%28Part+5%29" title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a>
</span>
<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/2012' rel='tag' target='_self'>2012</a>, <a class='technorati-link' href='http://technorati.com/tag/powershell' rel='tag' target='_self'>powershell</a>, <a class='technorati-link' href='http://technorati.com/tag/PowerShell+Studio' rel='tag' target='_self'>PowerShell Studio</a>, <a class='technorati-link' href='http://technorati.com/tag/PrimalForms' rel='tag' target='_self'>PrimalForms</a>, <a class='technorati-link' href='http://technorati.com/tag/what%27s+new+what%27s+changed' rel='tag' target='_self'>what's new what's changed</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://www.sapien.com/blog/2012/05/03/powershell-studio-2012-whats-new-part-5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PrimalScript 2012: What&#8217;s new? (Part 5)</title>
		<link>http://www.sapien.com/blog/2012/05/02/primalscript-2012-whats-new-part-5/</link>
		<comments>http://www.sapien.com/blog/2012/05/02/primalscript-2012-whats-new-part-5/#comments</comments>
		<pubDate>Wed, 02 May 2012 13:00:00 +0000</pubDate>
		<dc:creator>Alex Riedel</dc:creator>
				<category><![CDATA[PrimalScript]]></category>
		<category><![CDATA[Software News]]></category>
		<category><![CDATA[32 bit]]></category>
		<category><![CDATA[64 bit]]></category>
		<category><![CDATA[Object Explorer]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[PrimalScript 2012]]></category>

		<guid isPermaLink="false">http://www.sapien.com/blog/?p=3893</guid>
		<description><![CDATA[<br/>As promised last time we take a look at the new version of the Object Browser in PrimalScript 2012. As soon as you click on the PowerShell node you will notice two things: It opens a LOT faster. PrimalScript 2012 loads its information from a cache rather than instantiating a slow starting copy of PowerShell. [...]]]></description>
			<content:encoded><![CDATA[<br/><p>As promised last time we take a look at the new version of the Object Browser in PrimalScript 2012.</p>
<p><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.sapien.com/blog/wp-content/uploads/2012/03/image25.png" width="296" height="172"></p>
<p>As soon as you click on the PowerShell node you will notice two things:</p>
<ol>
<li>It opens a LOT faster. PrimalScript 2012 loads its information from a cache rather than instantiating a slow starting copy of PowerShell. This will actually come in handy in other aspects, which we will cover later.
<li>You see a 32 bit and a 64 bit node. While PrimalScript 2011 already supported both platforms in almost every aspect, the PowerShell browser was a strictly 32 bit affair. Not anymore. </li>
</ol>
<p>Having the platform distinction makes it possible for you to see if the snapin or module is actually available for you. Look closely at the following screenshot:</p>
<p><a href="http://www.sapien.com/blog/wp-content/uploads/2012/03/image26.png" target="_blank"><img style="background-image: none; border-right-width: 0px; margin: 0px 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.sapien.com/blog/wp-content/uploads/2012/03/image_thumb7.png" width="172" height="484"></a></p>
<p>You will notice that the Applocker module and it&#8217;s cmdlets are only available in 64 bit. As before, if you have the Dynamic Help window visible, just selecting an item will show it&#8217;s help information:</p>
<p><a href="http://www.sapien.com/blog/wp-content/uploads/2012/03/image27.png" target="_blank"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.sapien.com/blog/wp-content/uploads/2012/03/image_thumb8.png" width="644" height="147"></a></p>
<p>If you don&#8217;t like additional windows docked in your IDE, just right click and select Help…</p>
<p><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.sapien.com/blog/wp-content/uploads/2012/03/image28.png" width="246" height="129"></p>
<p>And the same text opens in the Document Explorer which, if you like, can be just parked on your secondary screen.</p>
<p><a href="http://www.sapien.com/blog/wp-content/uploads/2012/03/SNAGHTML2a002d14.png" target="_blank"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="SNAGHTML2a002d14" border="0" alt="SNAGHTML2a002d14" src="http://www.sapien.com/blog/wp-content/uploads/2012/03/SNAGHTML2a002d14_thumb.png" width="644" height="389"></a></p>
<p>You can also use the &#8220;Google this…&#8221; topic on the context menu to get more information and maybe find samples online.</p>
<p><a href="http://www.sapien.com/blog/wp-content/uploads/2012/03/image31.png" target="_blank"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.sapien.com/blog/wp-content/uploads/2012/03/image_thumb9.png" width="644" height="370"></a></p>
<p>So that&#8217;s it for today. Next time we look at some new debugging features for VBScript/JScript users. There is also a little debugger enhancement for PowerShell users in it, so don&#8217;t miss it.</p>

<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F02%2Fprimalscript-2012-whats-new-part-5%2F&amp;title=PrimalScript+2012%3A+What%26%238217%3Bs+new%3F+%28Part+5%29" title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F02%2Fprimalscript-2012-whats-new-part-5%2F&amp;title=PrimalScript+2012%3A+What%26%238217%3Bs+new%3F+%28Part+5%29" title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F02%2Fprimalscript-2012-whats-new-part-5%2F&amp;title=PrimalScript+2012%3A+What%26%238217%3Bs+new%3F+%28Part+5%29" title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F02%2Fprimalscript-2012-whats-new-part-5%2F&amp;title=PrimalScript+2012%3A+What%26%238217%3Bs+new%3F+%28Part+5%29" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F02%2Fprimalscript-2012-whats-new-part-5%2F&amp;title=PrimalScript+2012%3A+What%26%238217%3Bs+new%3F+%28Part+5%29', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://images.del.icio.us/static/img/delicious.small.gif" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F02%2Fprimalscript-2012-whats-new-part-5%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F02%2Fprimalscript-2012-whats-new-part-5%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F02%2Fprimalscript-2012-whats-new-part-5%2F&amp;title=PrimalScript+2012%3A+What%26%238217%3Bs+new%3F+%28Part+5%29" title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F02%2Fprimalscript-2012-whats-new-part-5%2F&amp;title=PrimalScript+2012%3A+What%26%238217%3Bs+new%3F+%28Part+5%29" title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a>
</span>
<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/32+bit' rel='tag' target='_self'>32 bit</a>, <a class='technorati-link' href='http://technorati.com/tag/64+bit' rel='tag' target='_self'>64 bit</a>, <a class='technorati-link' href='http://technorati.com/tag/Object+Explorer' rel='tag' target='_self'>Object Explorer</a>, <a class='technorati-link' href='http://technorati.com/tag/powershell' rel='tag' target='_self'>powershell</a>, <a class='technorati-link' href='http://technorati.com/tag/PrimalScript+2012' rel='tag' target='_self'>PrimalScript 2012</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://www.sapien.com/blog/2012/05/02/primalscript-2012-whats-new-part-5/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PowerShell Studio 2012: What&#8217;s New? (Part 4)</title>
		<link>http://www.sapien.com/blog/2012/05/01/powershell-studio-2012-whats-new-part-4/</link>
		<comments>http://www.sapien.com/blog/2012/05/01/powershell-studio-2012-whats-new-part-4/#comments</comments>
		<pubDate>Tue, 01 May 2012 16:07:00 +0000</pubDate>
		<dc:creator>David Corrales</dc:creator>
				<category><![CDATA[PowerShell Studio 2012]]></category>
		<category><![CDATA[PrimalForms]]></category>
		<category><![CDATA[Software News]]></category>
		<category><![CDATA[Windows PowerShell]]></category>
		<category><![CDATA[2012]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[PowerShell Studio]]></category>
		<category><![CDATA[what's new what's changed]]></category>

		<guid isPermaLink="false">http://www.sapien.com/blog/?p=4051</guid>
		<description><![CDATA[<br/>Last time we looked at the new Control Sets. Now we will take a look at the new Script Editor features: Improved Syntax Coloring PowerShell Studio 2012 now colors cmdlet and functions parameters: Convert Cmdlet &#38; Aliases Using the Context Menu or the Keyboard Shortcut you can convert your Cmdlets and Aliases. You can also [...]]]></description>
			<content:encoded><![CDATA[<br/><p>Last time we looked at the new Control Sets. Now we will take a look at the new Script Editor features:</p>
<p><strong></strong></p>
<p><strong>Improved Syntax Coloring</strong></p>
<p>PowerShell Studio 2012 now colors cmdlet and functions parameters:</p>
<p><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Parameter Coloring" border="0" alt="Parameter Coloring" src="http://www.sapien.com/blog/wp-content/uploads/2012/04/Parameter-Coloring.png" width="644" height="92"></p>
<p><strong></strong></p>
<p><strong>Convert Cmdlet &amp; Aliases</strong></p>
<p>Using the Context Menu or the Keyboard Shortcut you can convert your Cmdlets and Aliases. You can also convert from parameter aliases as well.</p>
<p><a href="http://www.sapien.com/blog/wp-content/uploads/2012/04/Convert-to-Alias.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Convert to Alias" border="0" alt="Convert to Alias" src="http://www.sapien.com/blog/wp-content/uploads/2012/04/Convert-to-Alias_thumb.png" width="244" height="112"></a></p>
<p>&nbsp;</p>
<p><strong><span style="font-size: small">Improved PrimalSense</span></strong></p>
<p>PowerShell Studio’s PrimalSense has also been greatly improved to increase your scripting productivity.</p>
<p><strong>Improved Parameter PrimalSense Support:</strong></p>
<p><a href="http://www.sapien.com/blog/wp-content/uploads/2012/04/Parameter-PrimalSense.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Parameter PrimalSense" border="0" alt="Parameter PrimalSense" src="http://www.sapien.com/blog/wp-content/uploads/2012/04/Parameter-PrimalSense_thumb.png" width="626" height="198"></a></p>
<p>&nbsp;</p>
<p>Improvements include PrimalSense completion for Enumerators and Special Types:</p>
<p><strong>Enumerator Code Completion:</strong></p>
<p><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Enumerator Code Completion" border="0" alt="Enumerator Code Completion" src="http://www.sapien.com/blog/wp-content/uploads/2012/04/Enumerator-Code-Completion.png" width="672" height="218"></p>
<p>&nbsp;</p>
<p><strong>PrimalSense for Special Types:</strong></p>
<p>PowerShell Studio will now display PrimalSense for special types such as Cursors and Colors:</p>
<p><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="PrimalSense for Colors" border="0" alt="PrimalSense for Colors" src="http://www.sapien.com/blog/wp-content/uploads/2012/04/PrimalSense-for-Colors.png" width="628" height="197"></p>
<p>&nbsp;</p>
<p>The improved PrimalSense will also display form control references:</p>
<p><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Select Form Controls" border="0" alt="Select Form Controls" src="http://www.sapien.com/blog/wp-content/uploads/2012/04/Select-Form-Controls.png" width="618" height="147"></p>
<p>Added Code Completion for Cmdlet and Function Parameters as well:</p>
<p><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Parameter Enum" border="0" alt="Parameter Enum" src="http://www.sapien.com/blog/wp-content/uploads/2012/04/Parameter-Enum.png" width="648" height="187"></p>
<p><strong></strong></p>
<p><strong>Parameter PrimalSense for Project Files:</strong></p>
<p>When you define a parameter block in a Project File, they will now be reflected in the PrimalSense.</p>
<p><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Parameter Block in ProjectFile" border="0" alt="Parameter Block in ProjectFile" src="http://www.sapien.com/blog/wp-content/uploads/2012/04/Parameter-Block-in-ProjectFile.png" width="491" height="135"></p>
<p><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Project File Parameters" border="0" alt="Project File Parameters" src="http://www.sapien.com/blog/wp-content/uploads/2012/04/Project-File-Parameters.png" width="450" height="127"></p>
<p><strong></strong></p>
<p><strong>Code Completion for Methods:</strong></p>
<p>A new feature that will help speed up your scripting is the new method completion.</p>
<p><a href="http://www.sapien.com/blog/wp-content/uploads/2012/04/Object-Methods.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Object Methods" border="0" alt="Object Methods" src="http://www.sapien.com/blog/wp-content/uploads/2012/04/Object-Methods_thumb.png" width="644" height="89"></a></p>
<p>Automatically insert the method parameters by pressing ‘Tab’:</p>
<p><a href="http://www.sapien.com/blog/wp-content/uploads/2012/04/Insert-Method-Parameters.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Insert Method Parameters" border="0" alt="Insert Method Parameters" src="http://www.sapien.com/blog/wp-content/uploads/2012/04/Insert-Method-Parameters_thumb.png" width="644" height="161"></a></p>
<p>You can Tab through each parameter and the PrimalSense will appear for the special types. Though you do not need to Tab complete the method parameters to benefit from the improved PrimalSense for special type arguments.</p>
<p><a href="http://www.sapien.com/blog/wp-content/uploads/2012/04/PrimalSense-for-Method-Parameters.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="PrimalSense for Method Parameters" border="0" alt="PrimalSense for Method Parameters" src="http://www.sapien.com/blog/wp-content/uploads/2012/04/PrimalSense-for-Method-Parameters_thumb.png" width="644" height="155"></a></p>
<p><strong></strong></p>
<p><strong>Improved Cmdlet PrimalSense:</strong></p>
<p>PowerShell Studio improves PrimalSense support for various cmdlets such as the <span style="color: #0000ff">Get-WmiObject</span> cmdlet:</p>
<p><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="GetWMIObject" border="0" alt="GetWMIObject" src="http://www.sapien.com/blog/wp-content/uploads/2012/04/GetWMIObject.png" width="672" height="130"></p>
<p>As see can you,&nbsp; PrimalSense for WMI namespaces and Classes are provided.</p>
<p>&nbsp;</p>
<p><strong>Script Navigation:</strong></p>
<p>The Script Editor now has a new navigation menu which allows you to quickly navigate within your scripts.</p>
<p><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Navigation Ribbon" border="0" alt="Navigation Ribbon" src="http://www.sapien.com/blog/wp-content/uploads/2012/04/Navigation-Ribbon.png" width="194" height="99"></p>
<p><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Next Menu" border="0" alt="Next Menu" src="http://www.sapien.com/blog/wp-content/uploads/2012/04/Next-Menu.png" width="195" height="129"></p>
<p>The Navigate menu in the Ribbon offers:</p>
<blockquote><p><em>Easy access to Bookmarks<br /></em>Add/Remove Bookmarks as well as navigate to and between them.</p>
<p><em>Function Navigate</em><br />Go to the next and previous function/event declaration.</p>
<p><em>Change Navigation</em><br />Navigate to modifications made within your script file. Modification are denoted by a yellow and green indicators.</p>
</blockquote>
<blockquote><p><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Modification Indicators" border="0" alt="Modification Indicators" src="http://www.sapien.com/blog/wp-content/uploads/2012/04/Modification-Indicators.png" width="390" height="77"></p>
<p><em>Occurrence Navigation</em><br />Navigate between occurrences of either variables, text or even cmdlets within your scripts.</p>
<p><em>Go to Last Edit Position</em><br />Press <strong>Ctrl + E</strong> and go to the last modification you made in the script.</p>
</blockquote>
<p><strong></strong></p>
<p><strong>Function Selection:</strong></p>
<p>Triple click on the line number column of the editor and it will automatically select the whole function.</p>
<p><a href="http://www.sapien.com/blog/wp-content/uploads/2012/04/Triple-Click-Function-Definition-Selection.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Triple Click Function Definition Selection" border="0" alt="Triple Click Function Definition Selection" src="http://www.sapien.com/blog/wp-content/uploads/2012/04/Triple-Click-Function-Definition-Selection_thumb.png" width="244" height="59"></a></p>
<p>&nbsp;</p>
<p><strong>CmdletBinding Support:</strong></p>
<p>Need to use CmdletBinding with your functions? Our PrimalSense now detects if a function uses CmdletBinding and displays the additional parameters the binding grants you.</p>
<p><a href="http://www.sapien.com/blog/wp-content/uploads/2012/04/CmdletBinding.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="CmdletBinding" border="0" alt="CmdletBinding" src="http://www.sapien.com/blog/wp-content/uploads/2012/04/CmdletBinding_thumb.png" width="194" height="244"></a></p>
<p>&nbsp;</p>
<p>Next: <a href="http://www.sapien.com/blog/2012/05/03/powershell-studio-2012-whats-new-part-5/">Part 5</a> &#8211; The new Function Explorer and other additions.</p>

<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F01%2Fpowershell-studio-2012-whats-new-part-4%2F&amp;title=PowerShell+Studio+2012%3A+What%26rsquo%3Bs+New%3F+%28Part+4%29" title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F01%2Fpowershell-studio-2012-whats-new-part-4%2F&amp;title=PowerShell+Studio+2012%3A+What%26rsquo%3Bs+New%3F+%28Part+4%29" title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F01%2Fpowershell-studio-2012-whats-new-part-4%2F&amp;title=PowerShell+Studio+2012%3A+What%26rsquo%3Bs+New%3F+%28Part+4%29" title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F01%2Fpowershell-studio-2012-whats-new-part-4%2F&amp;title=PowerShell+Studio+2012%3A+What%26rsquo%3Bs+New%3F+%28Part+4%29" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F01%2Fpowershell-studio-2012-whats-new-part-4%2F&amp;title=PowerShell+Studio+2012%3A+What%26rsquo%3Bs+New%3F+%28Part+4%29', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://images.del.icio.us/static/img/delicious.small.gif" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F01%2Fpowershell-studio-2012-whats-new-part-4%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F01%2Fpowershell-studio-2012-whats-new-part-4%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F01%2Fpowershell-studio-2012-whats-new-part-4%2F&amp;title=PowerShell+Studio+2012%3A+What%26rsquo%3Bs+New%3F+%28Part+4%29" title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F05%2F01%2Fpowershell-studio-2012-whats-new-part-4%2F&amp;title=PowerShell+Studio+2012%3A+What%26rsquo%3Bs+New%3F+%28Part+4%29" title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a>
</span>
<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/2012' rel='tag' target='_self'>2012</a>, <a class='technorati-link' href='http://technorati.com/tag/powershell' rel='tag' target='_self'>powershell</a>, <a class='technorati-link' href='http://technorati.com/tag/PowerShell+Studio' rel='tag' target='_self'>PowerShell Studio</a>, <a class='technorati-link' href='http://technorati.com/tag/PrimalForms' rel='tag' target='_self'>PrimalForms</a>, <a class='technorati-link' href='http://technorati.com/tag/what%27s+new+what%27s+changed' rel='tag' target='_self'>what's new what's changed</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://www.sapien.com/blog/2012/05/01/powershell-studio-2012-whats-new-part-4/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How safe are credentials in script packages?</title>
		<link>http://www.sapien.com/blog/2012/04/30/how-safe-are-credentials-in-script-packages/</link>
		<comments>http://www.sapien.com/blog/2012/04/30/how-safe-are-credentials-in-script-packages/#comments</comments>
		<pubDate>Mon, 30 Apr 2012 18:57:00 +0000</pubDate>
		<dc:creator>Alex Riedel</dc:creator>
				<category><![CDATA[Ask the Experts]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[PowerShell Studio 2012]]></category>
		<category><![CDATA[PrimalScript]]></category>
		<category><![CDATA[VBScript]]></category>
		<category><![CDATA[Windows PowerShell]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[disassembler]]></category>
		<category><![CDATA[Encryption]]></category>
		<category><![CDATA[exeutable]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[Script package]]></category>
		<category><![CDATA[username]]></category>

		<guid isPermaLink="false">http://www.sapien.com/blog/?p=4252</guid>
		<description><![CDATA[<br/>We get that question all the time. Before we start, please note that we do not advise to ever put credentials as plain text into any kind of code. Use encrypted strings, store encrypted credentials in files or, if all else fails, prompt. Now, having said that we all know that sometimes schedules and pressure [...]]]></description>
			<content:encoded><![CDATA[<br/><p>We get that question all the time. Before we start, please note that we do not advise to <strong>ever</strong> put credentials as plain text into any kind of code. Use encrypted strings, store encrypted credentials in files or, if all else fails, prompt. Now, having said that we all know that sometimes schedules and pressure from “above” forces you to do things you normally wouldn’t do. So for the sake of argument we have created a variety of executables which use SUPERADMINUSER and SUPERSTRONGPASSWORD to run a WMI query on SUPERSECRETSERVER.</p>
<p>We used </p>
<ol>
<li>VBScript</p>
<p><a href="http://www.sapien.com/blog/wp-content/uploads/2012/04/image.png" target="_blank"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.sapien.com/blog/wp-content/uploads/2012/04/image_thumb.png" width="644" height="105"></a> <br /> 
<li>PowerShell</p>
<p><a href="http://www.sapien.com/blog/wp-content/uploads/2012/04/image1.png" target="_blank"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.sapien.com/blog/wp-content/uploads/2012/04/image_thumb1.png" width="644" height="66"></a> <br /> 
<li>C#</p>
<p><a href="http://www.sapien.com/blog/wp-content/uploads/2012/04/image2.png" target="_blank"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.sapien.com/blog/wp-content/uploads/2012/04/image_thumb2.png" width="644" height="154"></a> <br /> 
<li>C++</p>
<p><a href="http://www.sapien.com/blog/wp-content/uploads/2012/04/image3.png" target="_blank"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.sapien.com/blog/wp-content/uploads/2012/04/image_thumb3.png" width="644" height="320"></a> </p>
</li>
</ol>
<p>Obviously all of these won’t run in your environment unless you create a server with that name and add those credentials. <br />If you want to examine the resulting executable files yourself, go to <a href="http://www.sapien.com/download">www.sapien.com/download</a> and look for WMIQueryExecutables.zip in the “Blog Samples” folder.</p>
<p>Now we take all these files and open them in PrimalScript as binary files and look for the user id and password, starting with the C++ version.</p>
</p>
<p>And here is your password, easily visible in the binary data:</p>
<p><a href="http://www.sapien.com/blog/wp-content/uploads/2012/04/image4.png" target="_blank"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.sapien.com/blog/wp-content/uploads/2012/04/image_thumb4.png" width="644" height="434"></a> </p>
<p>The spacing with NULL characters comes from the string being stored as unicode, so lets search for that in the C# version:</p>
<p><a href="http://www.sapien.com/blog/wp-content/uploads/2012/04/image5.png" target="_blank"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.sapien.com/blog/wp-content/uploads/2012/04/image_thumb5.png" width="644" height="434"></a> </p>
</p>
<p>As you can see, we didn’t have to look far. To make matters worse, if you take a disassembly tool to a .NET exe you don’t even have to read binary data:</p>
<p><a href="http://www.sapien.com/blog/wp-content/uploads/2012/04/SNAGHTML9cb1335.png" target="_blank"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="SNAGHTML9cb1335" border="0" alt="SNAGHTML9cb1335" src="http://www.sapien.com/blog/wp-content/uploads/2012/04/SNAGHTML9cb1335_thumb.png" width="644" height="370"></a></p>
<p>&nbsp;</p>
<p>Now let’s try the script packages created by PrimalScript:</p>
<p><a href="http://www.sapien.com/blog/wp-content/uploads/2012/04/image6.png" target="_blank"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.sapien.com/blog/wp-content/uploads/2012/04/image_thumb6.png" width="644" height="434"></a> </p>
<p>and</p>
<p><a href="http://www.sapien.com/blog/wp-content/uploads/2012/04/image7.png" target="_blank"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.sapien.com/blog/wp-content/uploads/2012/04/image_thumb7.png" width="644" height="434"></a> </p>
<p>So you see, if you have to, absolutely <strong>have</strong> to put credentials somewhere, a packaged script is the way to go.<br />Go ahead, get the binaries and see for yourself. Here is where they are once again: Go to <a href="http://www.sapien.com/download">www.sapien.com/download</a> and look for WMIQueryExecutables.zip in the “Blog Samples” folder.</p>

<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F04%2F30%2Fhow-safe-are-credentials-in-script-packages%2F&amp;title=How+safe+are+credentials+in+script+packages%3F" title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F04%2F30%2Fhow-safe-are-credentials-in-script-packages%2F&amp;title=How+safe+are+credentials+in+script+packages%3F" title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F04%2F30%2Fhow-safe-are-credentials-in-script-packages%2F&amp;title=How+safe+are+credentials+in+script+packages%3F" title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F04%2F30%2Fhow-safe-are-credentials-in-script-packages%2F&amp;title=How+safe+are+credentials+in+script+packages%3F" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F04%2F30%2Fhow-safe-are-credentials-in-script-packages%2F&amp;title=How+safe+are+credentials+in+script+packages%3F', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://images.del.icio.us/static/img/delicious.small.gif" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F04%2F30%2Fhow-safe-are-credentials-in-script-packages%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F04%2F30%2Fhow-safe-are-credentials-in-script-packages%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F04%2F30%2Fhow-safe-are-credentials-in-script-packages%2F&amp;title=How+safe+are+credentials+in+script+packages%3F" title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.sapien.com%2Fblog%2F2012%2F04%2F30%2Fhow-safe-are-credentials-in-script-packages%2F&amp;title=How+safe+are+credentials+in+script+packages%3F" title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a>
</span>
<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/c%23' rel='tag' target='_self'>c#</a>, <a class='technorati-link' href='http://technorati.com/tag/disassembler' rel='tag' target='_self'>disassembler</a>, <a class='technorati-link' href='http://technorati.com/tag/Encryption' rel='tag' target='_self'>Encryption</a>, <a class='technorati-link' href='http://technorati.com/tag/exeutable' rel='tag' target='_self'>exeutable</a>, <a class='technorati-link' href='http://technorati.com/tag/password' rel='tag' target='_self'>password</a>, <a class='technorati-link' href='http://technorati.com/tag/powershell' rel='tag' target='_self'>powershell</a>, <a class='technorati-link' href='http://technorati.com/tag/Script+package' rel='tag' target='_self'>Script package</a>, <a class='technorati-link' href='http://technorati.com/tag/username' rel='tag' target='_self'>username</a>, <a class='technorati-link' href='http://technorati.com/tag/VBScript' rel='tag' target='_self'>VBScript</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://www.sapien.com/blog/2012/04/30/how-safe-are-credentials-in-script-packages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

