<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="/rss.xsl"?><rss version="2.0"><channel><title>showui Discussions Rss Feed</title><link>http://www.codeplex.com/showui/Thread/List.aspx</link><description>showui Discussions Rss Description</description><item><title>New Post: How to check state of checkboxes?</title><link>http://showui.codeplex.com/discussions/429594</link><description>&lt;div style="line-height: normal;"&gt;Hi,&lt;br /&gt;
&lt;br /&gt;
Sorry for hijacking this thread but it was the closest to what I was looking for.  I'm trying something similar but with buttons as opposed to check boxes.  I give each of my buttons a name but nothing is returned.  Is there there some way to get this to work with buttons?&lt;br /&gt;
&lt;br /&gt;
Thank you,&lt;br /&gt;
&lt;br /&gt;
Mike&lt;br /&gt;
&lt;/div&gt;</description><author>mikecay</author><pubDate>Thu, 13 Jun 2013 17:24:34 GMT</pubDate><guid isPermaLink="false">New Post: How to check state of checkboxes? 20130613052434P</guid></item><item><title>New Post: How to direct command output to a window or textbox</title><link>http://showui.codeplex.com/discussions/446243</link><description>&lt;div style="line-height: normal;"&gt;If you need them in Invoke-Background, then you need to load the library file INSIDE the Invoke-Background scriptblock.&lt;br /&gt;
&lt;br /&gt;
NOTE: A library of functions is called a &amp;quot;module&amp;quot; in PowerShell, so you can just use &lt;code&gt;import-module C:\Path\File.ps1&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
Basically, the first command in your END block should be Import-Module. Or, you can add a &lt;code&gt;BEGIN { Import-Module YourModuleName }&lt;/code&gt; to preload it and keep the import separate from your code.&lt;br /&gt;
&lt;br /&gt;
Note: modules can be .ps1 files, but it makes sense to rename them to psm1 and even to put them in your PSModulesPath.  E.g.: &lt;code&gt;C:\users\YourName\Documents\WIndowsPowerShell\Modules\LibraryName\LibraryName.psm1&lt;/code&gt; Then you can just &lt;strong&gt;Import-Module LibraryName&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
See also: &lt;a href="http://msdn.microsoft.com/en-us/library/windows/desktop/dd878350.aspx" rel="nofollow"&gt;Installing Modules&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Also note: if you're on PowerShell 3, by moving your library to a folder that's inside a folder in your PSModulesPath you get auto-discovery, so you'd be able to skip the Import-Module (or dotsourcing or whatever you're doing right now) and just call the functions -- PowerShell would find them in the module and import it when needed.&lt;br /&gt;
&lt;/div&gt;</description><author>Jaykul</author><pubDate>Fri, 07 Jun 2013 16:07:03 GMT</pubDate><guid isPermaLink="false">New Post: How to direct command output to a window or textbox 20130607040703P</guid></item><item><title>New Post: How to direct command output to a window or textbox</title><link>http://showui.codeplex.com/discussions/446243</link><description>&lt;div style="line-height: normal;"&gt;Thank you for the quick responce.  I have a good grasp of PowerShell, I guess WPF is what I should be working on.&lt;br /&gt;
&lt;br /&gt;
I have a number of global variables that are common to both the PrepSystem and ConfigSystem routine.  I now have them in the -On_Loaded event when I create my frist grid and I pass the variables to the Invoke-Background parameter event.  So it looks like this now. &lt;br /&gt;
&lt;pre&gt;&lt;code&gt;$Windowparam = @{
    Width = 800
    Height = 600
    Title = 'System Configuration'
    Background = '#C4CBD8'
    WindowStartupLocation = 'CenterScreen'
    AsJob = $True
}

#Create Window
New-Window @Windowparam {
    New-Grid -Rows Auto,10,Auto,10,Auto,* -Children {
        New-Grid -Row 0 -Columns Auto,5,Auto -Children {
            New-Label -Column 0 'Select a ship'
            New-ComboBox -Name SystemName -Column 2 -IsReadOnly:$True -SelectedIndex 0 -Items {
                New-TextBlock -Text 'System 1 Name'
                New-TextBlock -Text 'System 2 Name'
                New-TextBlock -Text 'System 3 Name'
                New-TextBlock -Text 'System 34 Name' 
            }
        }
        New-Grid -Row 2 -Rows Auto,Auto -Columns Auto,5,75 -Children {
            New-Label -Row 0 -Column 0 'Administrator'
            New-TextBox -row 0 -Column 2 -Name AdminAccount
            New-Label -Row 1 -Column 0 'Password'
            New-PasswordBox -Name AdminPassword -row 1 -Column 2 
        }
        New-StackPanel -Row 4 -Orientation Horizontal {
            New-Button -Name PrepSystem -Width 85 -Height 25 -Row 0 -Column 0 -HorizontalAlignment Left -Content 'Prep System' -On_Click  {
                Invoke-Background -Control $PrepSystem {
                    Param ( $strSystemName, $strAdmin, $pswd , $GVar1, $GVar2, $GVar3)
                    End {
                        #Run My program here
                    }
                } -On_OutputChanged {
                    $SystemResults.Text = $PrepSystem.DataContext.Output;
                } -Parameter @{ 
                    strSystemName = $SystemName.Text
                    strAdmin = $AdminAccount.text
                    pswd = $AdminPassword.password
                    GVar1 = $GlobalVar1
                    GVar2 = $GlobalVar2
                    GVar3 = $GlobalVar3
                }
            }
            New-Label
            New-Button -Name ConfigSystem -Width 85 -Height 25 -Row 0 -Column 0 -HorizontalAlignment Left -Content 'Config System' -On_Click  {
                Invoke-Background -Control $ConfigSystem {
                    Param ( $strSystemName, $strAdmin, $pswd , $GVar1, $GVar2, $GVar3)
                    End {
                        #Run My program here
                    }
                } -On_OutputChanged {
                    $SystemResults.Text = $ConfigSystem.DataContext.Output;
                } -Parameter @{ 
                    strSystemName = $SystemName.Text
                    strAdmin = $AdminAccount.text
                    pswd = $AdminPassword.password
                    GVar1 = $GlobalVar1
                    GVar2 = $GlobalVar2
                    GVar3 = $GlobalVar3
                }
            }
            New-Label
            New-Button -Name CloseWindow -Width 85 -Height 25 -Row 0 -Column 4 -HorizontalAlignment Left -Content E_xit -On_Click {
                Close-Control
            }
        }
        New-TextBox -Row 5 -Name SystemResults -IsReadOnly:$True -TextWrapping Wrap -VerticalScrollBarVisibility Auto
    } -On_Loaded {
        $GlobalVar1 = &amp;quot;My Global Var1&amp;quot;
        $GlobalVar2 = &amp;quot;My Global Var2&amp;quot;
        $GlobalVar3 = &amp;quot;My Global Var3&amp;quot;
    }
}&lt;/code&gt;&lt;/pre&gt;

I'm still not sure how to call a function or use a function in my library.  Where do I put the function and at what point should I load my library file?&lt;br /&gt;
&lt;br /&gt;
Mike&lt;br /&gt;
&lt;/div&gt;</description><author>mikecay</author><pubDate>Fri, 07 Jun 2013 15:36:28 GMT</pubDate><guid isPermaLink="false">New Post: How to direct command output to a window or textbox 20130607033628P</guid></item><item><title>New Post: How to direct command output to a window or textbox</title><link>http://showui.codeplex.com/discussions/446243</link><description>&lt;div style="line-height: normal;"&gt;Honestly, I normally recommend my blog for learning ShowUI, but lately the forums here are outpacing my blog (I try very hard to give complete answers with relatively complete code examples, and the forum is user-driven).  Sadly, we've never gone through a systematic book-style from beginner to expert &amp;quot;how to write ShowUI&amp;quot; series of articles anywhere, so right now the best bet for learning ShowUI is reading blog posts and example code ... and learning about WPF and PowerShell in general separately, of course. &lt;br /&gt;
&lt;br /&gt;
I guess I should work on a series of articles for getting started to continue from my original walk-through to present more advanced topics...&lt;br /&gt;
&lt;br /&gt;
You should be able to call any functions that are defined globally from within your event handlers, but Invoke-Background is slightly different because it's spinning out a new thread and a totally new runspace. It's basically like Start-Job or Invoke-Command -AsJob: you have a new PowerShell instance (a new runspace), so you have to re-import your commands in order to use them.  That's why you have to use the -Parameter hashtable to send over anything that you need inside the Invoke-Background script block.  The event handlers (even the ones for Invoke-Background) of course, are running on &lt;em&gt;this&lt;/em&gt; thread (the one running your UI), so they don't have that problem.&lt;br /&gt;
&lt;/div&gt;</description><author>Jaykul</author><pubDate>Fri, 07 Jun 2013 14:02:01 GMT</pubDate><guid isPermaLink="false">New Post: How to direct command output to a window or textbox 20130607020201P</guid></item><item><title>New Post: Odd Noob Issue</title><link>http://showui.codeplex.com/discussions/446331</link><description>&lt;div style="line-height: normal;"&gt;That's really weird -- don't think anyone's ever had a failure with FixSerialization before. &lt;br /&gt;
What version of .Net do you have available: 3.0  or 3.5 or 4.0 or 4.5?&lt;br /&gt;
Can you dig into the StackTrace or InnerException properties on the $Error to figure out what really failed?&lt;br /&gt;
&lt;/div&gt;</description><author>Jaykul</author><pubDate>Fri, 07 Jun 2013 13:51:19 GMT</pubDate><guid isPermaLink="false">New Post: Odd Noob Issue 20130607015119P</guid></item><item><title>New Post: Odd Noob Issue</title><link>http://showui.codeplex.com/discussions/446331</link><description>&lt;div style="line-height: normal;"&gt;I was looking to use ShowUI in place of Primal for some simple user facing scripts but ran into an issue. The environment in question is Server 2003 with PowerShell 2 and ShowUI 1.4.&lt;br /&gt;
&lt;br /&gt;
When I use PowerGUI to develop the interface and import the module I have no issues (aside from a previously report &amp;quot;long&amp;quot; initial import time for x86 PowerShell).&lt;br /&gt;
&lt;br /&gt;
When I use PowerShell.exe or the Windows PowerShell ISE to create scripts, the module importation fails mid-import. Some cmdlets are available, but none after the failure point.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;import-Module showui&lt;/strong&gt;&lt;br /&gt;
_Exception calling &amp;quot;FixSerialization&amp;quot; with &amp;quot;0&amp;quot; argument(s): &amp;quot;Request failed.&amp;quot;&lt;br /&gt;
At \acct.upmchs.net\etg\CitrixRemote\PowerShell\MODULES\showui\ShowUI.psm1:137 char:38&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;
[ShowUI.XamlTricks]::FixSerialization &amp;lt;&amp;lt;&amp;lt;&amp;lt; ()&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;CategoryInfo          : NotSpecified: (:) [], MethodInvocationException&lt;/li&gt;
&lt;li&gt;
FullyQualifiedErrorId : DotNetMethodException_&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
Any ideas on what may be causing this?&lt;br /&gt;
&lt;/div&gt;</description><author>dlhall</author><pubDate>Fri, 07 Jun 2013 13:22:34 GMT</pubDate><guid isPermaLink="false">New Post: Odd Noob Issue 20130607012234P</guid></item><item><title>New Post: How to direct command output to a window or textbox</title><link>http://showui.codeplex.com/discussions/446243</link><description>&lt;div style="line-height: normal;"&gt;Excellent, works like a charm.&lt;br /&gt;
&lt;br /&gt;
I have a library file that I load with all my scripts and I often create other functions that are unique to each script.  When I call a function from my library file, or a function in the script, it does not work.  I tried to include the function in the -On_loaded event of the window and I also tried to add it at the top of my script, before creating the window, but neither works.  How can I call these functions?&lt;br /&gt;
&lt;br /&gt;
Other than the youtube videos where can I find some andvanced program documentation. For example the Invoke-Background, I would never have figured that out without asking.&lt;br /&gt;
&lt;br /&gt;
Thank you,&lt;br /&gt;
&lt;br /&gt;
Mike &lt;br /&gt;
&lt;/div&gt;</description><author>mikecay</author><pubDate>Fri, 07 Jun 2013 12:50:00 GMT</pubDate><guid isPermaLink="false">New Post: How to direct command output to a window or textbox 20130607125000P</guid></item><item><title>New Post: ShowUI background jobs (error?)</title><link>http://showui.codeplex.com/discussions/277403</link><description>&lt;div style="line-height: normal;"&gt;It's too late to help now, but I owed you this post, and maybe it will help someone else ...  the bottom line is that although you probably need to handle the events from InvokeBackground.  The databinding as in the example should work, but I have been playing with it for 2 hours and I am not able to get it to work ;-)&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://huddledmasses.org/long-running-background-tasks-in-showui-guis-from-powershell/" rel="nofollow"&gt;http://huddledmasses.org/long-running-background-tasks-in-showui-guis-from-powershell/&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;</description><author>Jaykul</author><pubDate>Fri, 07 Jun 2013 06:34:28 GMT</pubDate><guid isPermaLink="false">New Post: ShowUI background jobs (error?) 20130607063428A</guid></item><item><title>New Post: How to direct command output to a window or textbox</title><link>http://showui.codeplex.com/discussions/446243</link><description>&lt;div style="line-height: normal;"&gt;This may help too: &lt;a href="http://huddledmasses.org/long-running-background-tasks-in-showui-guis-from-powershell/" rel="nofollow"&gt;http://huddledmasses.org/long-running-background-tasks-in-showui-guis-from-powershell/&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;</description><author>Jaykul</author><pubDate>Fri, 07 Jun 2013 05:56:43 GMT</pubDate><guid isPermaLink="false">New Post: How to direct command output to a window or textbox 20130607055643A</guid></item><item><title>New Post: How to direct command output to a window or textbox</title><link>http://showui.codeplex.com/discussions/446243</link><description>&lt;div style="line-height: normal;"&gt;I wrote a nice long reply here, but then I accidentally clicked this button on the form and rebooted my computer ... no kidding.&lt;br /&gt;
&lt;br /&gt;
Anyway, the short version is, you can just do this:&lt;br /&gt;
&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
            New&lt;span style="color:Gray;"&gt;-&lt;/span&gt;Button &lt;span style="color:Gray;"&gt;-&lt;/span&gt;Name ConfigSystem &lt;span style="color:Gray;"&gt;-&lt;/span&gt;Width 85 &lt;span style="color:Gray;"&gt;-&lt;/span&gt;Height 25 &lt;span style="color:Gray;"&gt;-&lt;/span&gt;Row 0 &lt;span style="color:Gray;"&gt;-&lt;/span&gt;Column 2 &lt;span style="color:Gray;"&gt;-&lt;/span&gt;HorizontalAlignment Left &lt;span style="color:Gray;"&gt;-&lt;/span&gt;Content &lt;span style="color:#A31515;"&gt;&amp;#39;Config System&amp;#39;&lt;/span&gt; &lt;span style="color:Gray;"&gt;-&lt;/span&gt;On_Click {
                Run&lt;span style="color:Gray;"&gt;-&lt;/span&gt;ConfigSystem &lt;span style="color:OrangeRed;"&gt;$SystemName&lt;/span&gt;.Text | &lt;span style="color:Gray;"&gt;%&lt;/span&gt; { &lt;span style="color:OrangeRed;"&gt;$SystemResults&lt;/span&gt;.Text &lt;span style="color:Gray;"&gt;+=&lt;/span&gt; &lt;span style="color:#A31515;"&gt;&amp;quot;$_`n&amp;quot;&lt;/span&gt; }
            }
&lt;/pre&gt;&lt;/div&gt;But as you're no doubt aware, that won't actually update the UI because the UI is FROZEN waiting for the On_Click event handler (scriptblock) to exit ...&lt;br /&gt;
&lt;br /&gt;
In order to keep the UI responsive while you do work, you have to use Invoke-Background (or some other function like it).  This is the least used part of ShowUI, and hasn't been properly documented, but it does work.  Basically, take your &lt;strong&gt;Run-PrepSystem&lt;/strong&gt; function and pull it right into the event handler on the button, like this:&lt;br /&gt;
&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
            New&lt;span style="color:Gray;"&gt;-&lt;/span&gt;Button &lt;span style="color:Gray;"&gt;-&lt;/span&gt;Name PrepSystem &lt;span style="color:Gray;"&gt;-&lt;/span&gt;Width 85 &lt;span style="color:Gray;"&gt;-&lt;/span&gt;Height 25 &lt;span style="color:Gray;"&gt;-&lt;/span&gt;Row 0 &lt;span style="color:Gray;"&gt;-&lt;/span&gt;Column 0 &lt;span style="color:Gray;"&gt;-&lt;/span&gt;HorizontalAlignment Left &lt;span style="color:Gray;"&gt;-&lt;/span&gt;Content &lt;span style="color:#A31515;"&gt;&amp;#39;Prep System&amp;#39;&lt;/span&gt; &lt;span style="color:Gray;"&gt;-&lt;/span&gt;On_Click {
                &lt;span style="color:Green;"&gt;# Disable the button so they can&amp;#39;t click it again:&lt;/span&gt;
                &lt;span style="color:Green;"&gt;# NOTE: Invoke-Background isn&amp;#39;t cancellable (yet)&lt;/span&gt;
                &lt;span style="color:OrangeRed;"&gt;$PrepSystem&lt;/span&gt;.Enabled &lt;span style="color:Gray;"&gt;=&lt;/span&gt; &lt;span style="color:OrangeRed;"&gt;$false&lt;/span&gt;

                &lt;span style="color:Green;"&gt;# The control specified to Invoke-Background &lt;/span&gt;
                &lt;span style="color:Green;"&gt;# will have its DataContext set to the background job results&lt;/span&gt;
                Invoke&lt;span style="color:Gray;"&gt;-&lt;/span&gt;Background &lt;span style="color:Gray;"&gt;-&lt;/span&gt;Control &lt;span style="color:OrangeRed;"&gt;$PrepSystem&lt;/span&gt; {
                    &lt;span style="color:Gray;"&gt;[&lt;/span&gt;&lt;span style="color:Teal;"&gt;cmdletbinding()&lt;/span&gt;&lt;span style="color:Gray;"&gt;]&lt;/span&gt;
                    &lt;span style="color:Green;"&gt;# The values to these have to be passed in the -Parameter hashtable&lt;/span&gt;
                    Param ( &lt;span style="color:OrangeRed;"&gt;$strSystemName&lt;/span&gt;, &lt;span style="color:OrangeRed;"&gt;$strAdmin&lt;/span&gt;, &lt;span style="color:OrangeRed;"&gt;$pswd&lt;/span&gt; )
                    End {
                        &lt;span style="color:#A31515;"&gt;&amp;quot;`nImporting System Configuration Data`n&amp;quot;&lt;/span&gt;

                        Start&lt;span style="color:Gray;"&gt;-&lt;/span&gt;Sleep &lt;span style="color:Gray;"&gt;-&lt;/span&gt;milli 500 &lt;span style="color:Green;"&gt;# simulate work ...&lt;/span&gt;
                        &lt;span style="color:Green;"&gt;# $objSystemData = Import-Csv .\ststemdata.csv | Where-Object {$_.systemname -eq $strSystemName}&lt;/span&gt;

                        &lt;span style="color:#A31515;"&gt;&amp;quot;`nCopying Configuration files to C:\temp`n&amp;quot;&lt;/span&gt;
                        
                        &lt;span style="color:Green;"&gt;# Other configuration steps here&lt;/span&gt;
                        &lt;span style="color:Green;"&gt;# would like the output of some commands to show up ...&lt;/span&gt;
                        Start&lt;span style="color:Gray;"&gt;-&lt;/span&gt;Sleep 5 &lt;span style="color:Green;"&gt;# simulate work ...&lt;/span&gt;

                        &lt;span style="color:#A31515;"&gt;&amp;quot;`nSystem is ready for final configuration&amp;quot;&lt;/span&gt;
                        &lt;span style="color:#A31515;"&gt;&amp;quot;`nSystem will reboot in 10 seconds&amp;quot;&lt;/span&gt;

                        Start&lt;span style="color:Gray;"&gt;-&lt;/span&gt;Sleep &lt;span style="color:Gray;"&gt;-&lt;/span&gt;Seconds 10

                        &lt;span style="color:#A31515;"&gt;&amp;quot;`nRestarting remote computer  $strSystemName&amp;quot;&lt;/span&gt;
                        Restart&lt;span style="color:Gray;"&gt;-&lt;/span&gt;Computer &lt;span style="color:Gray;"&gt;-&lt;/span&gt;ComputerName &lt;span style="color:OrangeRed;"&gt;$strSystemName&lt;/span&gt; &lt;span style="color:Gray;"&gt;-&lt;/span&gt;Force
                    }

                } &lt;span style="color:Gray;"&gt;-&lt;/span&gt;On_OutputChanged {
                    &lt;span style="color:Green;"&gt;# In the event handlers, we use the control&amp;#39;s DataContext&lt;/span&gt;
                    &lt;span style="color:OrangeRed;"&gt;$SystemResults&lt;/span&gt;.Text &lt;span style="color:Gray;"&gt;=&lt;/span&gt; &lt;span style="color:OrangeRed;"&gt;$PrepSystem&lt;/span&gt;.DataContext.Output;
                } &lt;span style="color:Gray;"&gt;-&lt;/span&gt;On_IsFinishedChanged {
                    &lt;span style="color:Blue;"&gt;if&lt;/span&gt;(&lt;span style="color:OrangeRed;"&gt;$PrepSystem&lt;/span&gt;.DataContext.IsFinished) { 
                        &lt;span style="color:OrangeRed;"&gt;$PrepSystem&lt;/span&gt;.Enabled &lt;span style="color:Gray;"&gt;=&lt;/span&gt; &lt;span style="color:OrangeRed;"&gt;$true&lt;/span&gt;
                    }
                } &lt;span style="color:Gray;"&gt;-&lt;/span&gt;Parameter @{ 
                    &lt;span style="color:Green;"&gt;# NOTE THESE MUST MATCH THE PARAM BLOCK EXACTLY&lt;/span&gt;
                    strSystemName &lt;span style="color:Gray;"&gt;=&lt;/span&gt; &lt;span style="color:OrangeRed;"&gt;$SystemName&lt;/span&gt;.Text
                    strAdmin &lt;span style="color:Gray;"&gt;=&lt;/span&gt; &lt;span style="color:OrangeRed;"&gt;$AdminAccount&lt;/span&gt;.text
                    pswd &lt;span style="color:Gray;"&gt;=&lt;/span&gt; &lt;span style="color:OrangeRed;"&gt;$AdminPassword&lt;/span&gt;.password
                }
            }
&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;</description><author>Jaykul</author><pubDate>Thu, 06 Jun 2013 23:30:59 GMT</pubDate><guid isPermaLink="false">New Post: How to direct command output to a window or textbox 20130606113059P</guid></item><item><title>New Post: How to direct command output to a window or textbox</title><link>http://showui.codeplex.com/discussions/446243</link><description>&lt;div style="line-height: normal;"&gt;Hi,&lt;br /&gt;
&lt;br /&gt;
I'm still very green when it comes to ShowUI, most of my code is peiced together from examples seen in the net.  In any case, I hope you can help me with this code.  I'm sure I'm way off base here.  I have to following program (mostly taken from the showui_converter).  I would like to show to output from the various function in the bottom window of the interface.  I understand how to output to the text box by saving the output to $SystemResults.text, but I would like to output to be progressing, as the program is running.&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;Import-Module showui
$Windowparam = @{
    Width = 800
    Height = 600
    Title = 'System Configuration'
    Background = '#C4CBD8'
    WindowStartupLocation = 'CenterScreen'
    AsJob = $True
}

#Create Window
New-Window @Windowparam {
    New-Grid -Rows Auto,10,Auto,10,Auto,* -Children {
        New-Grid -Row 0 -Columns Auto,5,Auto -Children {
            New-Label -Column 0 'Select a ship'
            New-ComboBox -Name SystemName -Column 2 -IsReadOnly:$True -SelectedIndex 0 -Items {
                New-TextBlock -Text 'System 1 Name'
                New-TextBlock -Text 'System 2 Name'
                New-TextBlock -Text 'System 3 Name'
                New-TextBlock -Text 'System 34 Name' 
            }
        }
        New-Grid -Row 2 -Rows Auto,Auto -Columns Auto,5,75 -Children {
            New-Label -Row 0 -Column 0 'Administrator'
            New-TextBox -row 0 -Column 2 -Name AdminAccount
            New-Label -Row 1 -Column 0 'Password'
            New-PasswordBox -Name AdminPassword -row 1 -Column 2 
        }
        New-StackPanel -Row 4 -Orientation Horizontal {
            New-Button -Name PrepSystem -Width 85 -Height 25 -Row 0 -Column 0 -HorizontalAlignment Left -Content 'Prep System' -On_Click {
                Run-PrepSystem $SystemName.Text $AdminAccount.text $AdminPassword.password
            }
            New-Label
            New-Button -Name ConfigSystem -Width 85 -Height 25 -Row 0 -Column 2 -HorizontalAlignment Left -Content 'Config System' -On_Click {
                Run-ConfigSystem $SystemName.Text
            }
            New-Label
            New-Button -Name CloseWindow -Width 85 -Height 25 -Row 0 -Column 4 -HorizontalAlignment Left -Content E_xit -On_Click {
                Close-Control
            }
            
        }
        New-TextBox -Row 5 -Name SystemResults -IsReadOnly:$True -TextWrapping Wrap -VerticalScrollBarVisibility Auto
    }
} -On_Loaded {
    Function Run-PrepSystem {
        [cmdletbinding()]
        Param (
            [parameter(ValueFromPipeLine='True')]    
            $strSystemName,
            $strAdmin,
            $pswd
        )
         Begin {
        }
        Process {
            &amp;quot;`nImporting System Configuration Data`n&amp;quot;
            $objSystemData = Import-Csv .\ststemdata.csv | Where-Object {$_.systemname -eq $strSystemName}
            &amp;quot;`nCopying Configuration files to C:\temp`n&amp;quot;
            # Other configuration steps here
            # would like the output of some commends to show in the Outputbox text field
            &amp;quot;`nSystem is ready for final configuration&amp;quot;
            &amp;quot;`nSystem will reboot in 10 seconds&amp;quot;
            Start-Sleep -Seconds 10
            Restart-Computer -Force
        }
        End {
        }
    }

    Function Run-ConfigSystem {
        [cmdletbinding()]
        Param (
            $strSystemName,
            $strAdmin,
            $pswd
        )
        Begin {
        }
        Process {
            #Perform Configuration here
        }
        End {
        }
    }

}
&lt;/code&gt;&lt;/pre&gt;

Also, where is a good place to start learning how to use some of the more advances features of ShowUI.&lt;br /&gt;
&lt;br /&gt;
Regards,&lt;br /&gt;
&lt;br /&gt;
Mike&lt;br /&gt;
&lt;/div&gt;</description><author>mikecay</author><pubDate>Thu, 06 Jun 2013 17:35:30 GMT</pubDate><guid isPermaLink="false">New Post: How to direct command output to a window or textbox 20130606053530P</guid></item><item><title>New Post: Bare minumum needed to run ShowUI?</title><link>http://showui.codeplex.com/discussions/444582</link><description>&lt;div style="line-height: normal;"&gt;If you import the module on the first system, the assemblies are generated -- then you can just xcopy deploy that ShowUI folder to the other systems.&lt;br /&gt;
&lt;/div&gt;</description><author>Jaykul</author><pubDate>Fri, 31 May 2013 03:03:48 GMT</pubDate><guid isPermaLink="false">New Post: Bare minumum needed to run ShowUI? 20130531030348A</guid></item><item><title>New Post: Bare minumum needed to run ShowUI?</title><link>http://showui.codeplex.com/discussions/444582</link><description>&lt;div style="line-height: normal;"&gt;Hi, &lt;br /&gt;
Do you know how I can pregenerate the assemblies, so it's not always run the first time on every pc/server?&lt;br /&gt;
&lt;br /&gt;
Thanks a lot&lt;br /&gt;
&lt;/div&gt;</description><author>Kurtdg</author><pubDate>Thu, 30 May 2013 11:59:23 GMT</pubDate><guid isPermaLink="false">New Post: Bare minumum needed to run ShowUI? 20130530115923A</guid></item><item><title>New Post: Bare minumum needed to run ShowUI?</title><link>http://showui.codeplex.com/discussions/444582</link><description>&lt;div style="line-height: normal;"&gt;It's kind-of an exercise in yak-shaving, don't you think?  On my system the whole module's taking up about 8.5 MB, of which 8.1MB is the actual compiled ShowUI.dll ... so yes, you could shave a few kb off, but it seems like more effort than it's worth.&lt;br /&gt;
&lt;br /&gt;
In any case, you can definitely remove the &amp;quot;Examples&amp;quot; folder, and if you have anything in a &amp;quot;GeneratedCode&amp;quot; folder, that would be the first thing to remove (as it's larger than the .dll, if it's present, and it's absolutely not needed). Once the assemblies are generated, I suppose you can also take out the &amp;quot;C#&amp;quot; folder and the meager help in the &amp;quot;en-us&amp;quot; folder. I think that deleting anything else would require modifications to the module script to avoid errors about the missing files, but you could hypothetically remove the Styles and StyleSystem and CommonControls if you don't use those, and the CodeGenerator folder (again, only if you first patch the main module to not try to execute them).&lt;br /&gt;
&lt;/div&gt;</description><author>Jaykul</author><pubDate>Wed, 22 May 2013 23:42:46 GMT</pubDate><guid isPermaLink="false">New Post: Bare minumum needed to run ShowUI? 20130522114246P</guid></item><item><title>New Post: Can't get anything from New-PasswordBox</title><link>http://showui.codeplex.com/discussions/443940</link><description>&lt;div style="line-height: normal;"&gt;
&lt;div dir="ltr"&gt;That should work ... you don't need to assign it to a variable, actually -- you can just do `function NewPassword { Grid ... -show }`&lt;br&gt;
&lt;/div&gt;
&lt;div&gt;&lt;br clear="all"&gt;
&lt;div&gt;--&lt;br&gt;
Joel &amp;quot;Jaykul&amp;quot; Bennett&lt;br&gt;
&lt;a href="http://HuddledMasses.org" target="_blank"&gt;http://HuddledMasses.org&lt;/a&gt;&lt;br&gt;
&lt;a href="http://PowerShellGroup.org" target="_blank"&gt;http://PowerShellGroup.org&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;br&gt;
&lt;div&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;</description><author>Jaykul</author><pubDate>Wed, 22 May 2013 16:30:36 GMT</pubDate><guid isPermaLink="false">New Post: Can't get anything from New-PasswordBox 20130522043036P</guid></item><item><title>New Post: Bare minumum needed to run ShowUI?</title><link>http://showui.codeplex.com/discussions/444582</link><description>&lt;div style="line-height: normal;"&gt;Hi,&lt;br /&gt;
&lt;br /&gt;
I need to put showui on 34 servers but I was wondering what it the bare minumum needed to import and run the showUI module? I see there is over 100 files in the ShowUI ZIP package and I am sure the examples can be left out but are there any others?&lt;br /&gt;
&lt;br /&gt;
Thank you,&lt;br /&gt;
&lt;br /&gt;
Mike&lt;br /&gt;
&lt;/div&gt;</description><author>mikecay</author><pubDate>Wed, 22 May 2013 12:40:08 GMT</pubDate><guid isPermaLink="false">New Post: Bare minumum needed to run ShowUI? 20130522124008P</guid></item><item><title>New Post: Can't get anything from New-PasswordBox</title><link>http://showui.codeplex.com/discussions/443940</link><description>&lt;div style="line-height: normal;"&gt;Thank you for the response, it is very clear.  I was going to put the above script in a function and return the secure password, I assume all I have to do is the following:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;Function ValidatePswd
{
$ValidPswd = Grid -Controlname Get-Passwords -Rows &amp;quot;Auto&amp;quot;,&amp;quot;Auto&amp;quot;,5,&amp;quot;Auto&amp;quot; -Columns &amp;quot;Auto&amp;quot;,100 -Margin 3 {

    New-Label &amp;quot;Enter Password&amp;quot;
    New-PasswordBox -Name EnterPassword -Column 1

    New-Label &amp;quot;Confirm Password&amp;quot; -Row 1
    New-PasswordBox -Name ConfirmPassword -Column 1 -Row 1

    New-Button &amp;quot;OK&amp;quot; -Column 1 -Row 3 -On_Click { 
        if( $EnterPassword.Password -eq $ConfirmPassword.Password) {
            Get-ParentControl | Set-UIValue -Value $EnterPassword.SecurePassword -passthru | Close-Control 
        } else {
            $ConfirmPassword.Clear()
        }
    }
} -show

Return $ValidPswd
}
&lt;/code&gt;&lt;/pre&gt;

Great product and Thanks for everything.&lt;br /&gt;
&lt;br /&gt;
Mmike&lt;br /&gt;
&lt;/div&gt;</description><author>mikecay</author><pubDate>Wed, 22 May 2013 12:33:53 GMT</pubDate><guid isPermaLink="false">New Post: Can't get anything from New-PasswordBox 20130522123353P</guid></item><item><title>New Post: What am I doing wrong ?</title><link>http://showui.codeplex.com/discussions/443747</link><description>&lt;div style="line-height: normal;"&gt;I've verified on vanilla Windows 8, get the same results...&lt;br /&gt;
I noticed the following:&lt;br /&gt;
In the video from James about running showui side by side:&lt;br /&gt;
&lt;a href="http://www.youtube.com/watch?v=gQTGi5kUGKk" rel="nofollow"&gt;http://www.youtube.com/watch?v=gQTGi5kUGKk&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
I noticed James runs get-uicommand | measure-object&lt;br /&gt;
His results on .net 3.5 are 184 commands, 218 commands on .net 4.0&lt;br /&gt;
&lt;br /&gt;
Running same command I consistently get&lt;br /&gt;
PS C:&amp;gt; get-uicommand | measure-object&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Count    : 122&lt;br /&gt;
Average  :&lt;br /&gt;
Sum      :&lt;br /&gt;
Maximum  :&lt;br /&gt;
Minimum  :&lt;br /&gt;
Property :&lt;br /&gt;
&lt;br /&gt;
Whether I'm running on Windows Server 2012 or Windows 8, both vanilla...&lt;br /&gt;
&lt;br /&gt;
once again, on Windows 8, the home-page example gives me same result again:&lt;br /&gt;
&lt;br /&gt;
PS C:&amp;gt; $getEventInput = StackPanel -ControlName 'Get-EventLogsSinceDate' {&lt;br /&gt;
&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;pre&gt;&lt;code&gt;New-Label -VisualStyle 'MediumText' &amp;quot;Log Name&amp;quot;
New-ComboBox -IsEditable:$false -SelectedIndex 0 -Name LogName @(&amp;quot;Application&amp;quot;, &amp;quot;Security&amp;quot;, &amp;quot;System&amp;quot;, &amp;quot;Setup&amp;quot;)
New-Label -VisualStyle 'MediumText' &amp;quot;Get Event Logs Since...&amp;quot;
Select-Date -Name After
New-Button &amp;quot;Get Events&amp;quot; -On_Click {
    Get-ParentControl |
        Set-UIValue -passThru |
        Close-Control
}&lt;/code&gt;&lt;/pre&gt;

} -show&lt;br /&gt;
&lt;br /&gt;
PS C:&amp;gt; Get-EventLog @getEventInput&lt;br /&gt;
Get-EventLog : A parameter cannot be found that matches parameter name 'toggleButton'.&lt;br /&gt;
At line:1 char:14&lt;br /&gt;
&lt;/blockquote&gt;
&lt;/blockquote&gt;
&lt;ul&gt;
&lt;li&gt;Get-EventLog @getEventInput&lt;/li&gt;
&lt;li&gt;
~~~~~~~~~~~~~~&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;CategoryInfo          : InvalidArgument: (:) [Get-EventLog], ParameterBindingException&lt;/li&gt;
&lt;li&gt;
FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.GetEventLogCommand&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
This leads me to believe the showui.1.4.zip offered here is broken/incomplete...&lt;br /&gt;
Could this be the case ? Please verify...&lt;br /&gt;
Thanks in advance...&lt;br /&gt;
&lt;/div&gt;</description><author>Wizard17</author><pubDate>Mon, 20 May 2013 09:57:27 GMT</pubDate><guid isPermaLink="false">New Post: What am I doing wrong ? 20130520095727A</guid></item><item><title>New Post: What am I doing wrong ?</title><link>http://showui.codeplex.com/discussions/443747</link><description>&lt;div style="line-height: normal;"&gt;
&lt;div&gt;
&lt;p&gt;&lt;span style="font-size:10.0pt; font-family:"&gt;Once more, be aware I'm running from Windows Server 2012 Datacenter build 9200, NOT windos 8&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:10.0pt; font-family:"&gt;(I have found many incompatibilities between the two all related to .NET: Win8 comes with .NET 4.0, 2012 with 4.5,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:10.0pt; font-family:"&gt;I know there should be no incompatibilities, but sadly it seems there are plentyfull)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:10.0pt; font-family:"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:10.0pt; font-family:"&gt;1)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:10.0pt; font-family:"&gt;PS C:\&amp;gt; $PSVersionTable&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:10.0pt; font-family:"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:10.0pt; font-family:"&gt;Name Value&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:10.0pt; font-family:"&gt;---- -----&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:10.0pt; font-family:"&gt;PSVersion 3.0&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:10.0pt; font-family:"&gt;WSManStackVersion 3.0&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:10.0pt; font-family:"&gt;SerializationVersion 1.1.0.1&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:10.0pt; font-family:"&gt;CLRVersion 4.0.30319.18033&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:10.0pt; font-family:"&gt;BuildVersion 6.2.9200.16434&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:10.0pt; font-family:"&gt;PSCompatibleVersions {1.0, 2.0, 3.0}&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:10.0pt; font-family:"&gt;PSRemotingProtocolVersion 2.2&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:10.0pt; font-family:"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:10.0pt; font-family:"&gt;2)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:10.0pt; font-family:"&gt;PS C:\&amp;gt; Get-Module ShowUI -List | Format-Table Name, Version&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:10.0pt; font-family:"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:10.0pt; font-family:"&gt;Name Version&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:10.0pt; font-family:"&gt;---- -------&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:10.0pt; font-family:"&gt;ShowUI 1.4&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:10.0pt; font-family:"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:10.0pt; font-family:"&gt;Your example gives me what I posted:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:10.0pt; font-family:"&gt;1) The window shows up, but is NOT focused&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:10.0pt; font-family:"&gt;2) Clicking inside textfield, I can enter text&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:10.0pt; font-family:"&gt;3) hitting enter or clicking OK, nothing happens&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:10.0pt; font-family:"&gt;4) Closing the window, no output gets set, as you explain, it's like cancelling, so that's understandable&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:10.0pt; font-family:"&gt;5) What's not understandable, is that clicking OK doesn't exist the window with result&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:10.0pt; font-family:"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:10.0pt; font-family:"&gt;Please read my post again, this was one of two ways to program this example, the other one than this one does work,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:10.0pt; font-family:"&gt;(using $window.close()) but throws an error as decribed. None of the examples work, for example the one on homepage about eventlog gives me this:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:10.0pt; font-family:"&gt;1) Windows opens, I can chose a date&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:10.0pt; font-family:"&gt;2) When I click Events, following eror shows up:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:10.0pt; font-family:"&gt;PS C:\&amp;gt; Get-EventLog @getEventInput&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:10.0pt; font-family:"&gt;Get-EventLog : A parameter cannot be found that matches parameter name 'toggleButton'.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:10.0pt; font-family:"&gt;At line:1 char:14&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:10.0pt; font-family:"&gt;&amp;#43; Get-EventLog @getEventInput&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:10.0pt; font-family:"&gt;&amp;#43; ~~~~~~~~~~~~~~&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:10.0pt; font-family:"&gt;&amp;#43; CategoryInfo : InvalidArgument: (:) [Get-EventLog], ParameterBindingException&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:10.0pt; font-family:"&gt;&amp;#43; FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.GetEventLogCommand&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:10.0pt; font-family:"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;
&lt;p&gt;&lt;span style="font-size:10.0pt; font-family:"&gt;The error is correct in that if I look at what's returned, it gives me:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:10.0pt; font-family:"&gt;PS C:\&amp;gt; $geteventinput&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:10.0pt; font-family:"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:10.0pt; font-family:"&gt;Name Value&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:10.0pt; font-family:"&gt;---- -----&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:10.0pt; font-family:"&gt;toggleButton False&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:10.0pt; font-family:"&gt;LogName Application&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:10.0pt; font-family:"&gt;After 18-05-2013 00:00:00&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:10.0pt; font-family:"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:10.0pt; font-family:"&gt;Ofcourse, the get-eventlog cannot deal with that object…&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:10.0pt; font-family:"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:10.0pt; font-family:"&gt;I'm convinced nothing is wrong with ShowUI, it just doesn't seem to work on server 2012&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:10.0pt; font-family:"&gt;I've tried on at least 3 different 2012 servers, some having .NET 3.5 aswell as 4.5 installed (see Server Manager), and others only having 4.5 installed&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:10.0pt; font-family:"&gt;Results are consistent and always like the above… The examples from the examples folder all don't work or give errors, similar to these examples&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:10.0pt; font-family:"&gt;Also ran from a vanilla 2012 server, same results. Has ShowUI been tested on a 2012 server ?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:10.0pt; font-family:"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:10.0pt; font-family:"&gt;Met vriendelijke groet / Kind regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:10.0pt; font-family:"&gt;Bart van de Beek&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:10.0pt; font-family:"&gt;[email removed]&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:10.0pt; font-family:"&gt;M: 0031 6 42626589&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;&lt;span style="font-size:10.0pt; font-family:"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;
&lt;div style="border:none; border-top:solid #E1E1E1 1.0pt; padding:3.0pt 0cm 0cm 0cm"&gt;
&lt;p&gt;&lt;b&gt;&lt;span style="font-size:11.0pt; font-family:"&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;</description><author>Wizard17</author><pubDate>Sun, 19 May 2013 13:03:27 GMT</pubDate><guid isPermaLink="false">New Post: What am I doing wrong ? 20130519010327P</guid></item><item><title>New Post: What am I doing wrong ?</title><link>http://showui.codeplex.com/discussions/443747</link><description>&lt;div style="line-height: normal;"&gt;ShowUI 1.4 is compatible with PowerShell 3 (in fact, that's really the only reason we released a 1.4).  PowerShell 3 runs in -STA mode by default (yay!) and ShowUI definitely does not require elevation.&lt;br /&gt;
&lt;br /&gt;
Both of your examples are working fine for me here. Your first example should definitely NOT return anything if you just close the window (that's like hitting Cancel), but otherwise, because you put -IsDefault on the OK button, pressing enter is like clicking that button, and will trigger it's On_Click event handler.&lt;br /&gt;
&lt;br /&gt;
There seems to be something weird going on which is causing the $Prompt variable to not be set for you, which would break both of those examples.&lt;br /&gt;
&lt;br /&gt;
Can you check two things:&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;Run &lt;code&gt;$PSVersionTable&lt;/code&gt; and be sure your PSVersion is 3.0&lt;/li&gt;
&lt;li&gt;
Run &lt;code&gt;Get-Module ShowUI -List | Format-Table Name, Version&lt;/code&gt; and be sure you only have one module listed, and that it is version 1.4&lt;br /&gt;
&lt;/li&gt;
&lt;/ol&gt;
If your versions are right, can you try this and let me know where it goes wrong, exactly?&lt;br /&gt;
&lt;div style="color:Black;background-color:White;"&gt;&lt;pre&gt;
StackPanel &lt;span style="color:Gray;"&gt;-&lt;/span&gt;ControlName &lt;span style="color:#A31515;"&gt;&amp;quot;Prompt&amp;quot;&lt;/span&gt; &lt;span style="color:Gray;"&gt;-&lt;/span&gt;Margin &lt;span style="color:#A31515;"&gt;&amp;quot;8,0,8,8&amp;quot;&lt;/span&gt; {
    Label &lt;span style="color:#A31515;"&gt;&amp;quot;Please Enter Your Full Name:&amp;quot;&lt;/span&gt;
    StackPanel &lt;span style="color:Gray;"&gt;-&lt;/span&gt;Orientation Horizontal {
        TextBox &lt;span style="color:Gray;"&gt;-&lt;/span&gt;Name FullName &lt;span style="color:Gray;"&gt;-&lt;/span&gt;Width 100
        Button &lt;span style="color:#A31515;"&gt;&amp;quot;OK&amp;quot;&lt;/span&gt; &lt;span style="color:Gray;"&gt;-&lt;/span&gt;IsDefault &lt;span style="color:Gray;"&gt;-&lt;/span&gt;Width 50 &lt;span style="color:Gray;"&gt;-&lt;/span&gt;Margin &lt;span style="color:#A31515;"&gt;&amp;quot;8,0,0,0&amp;quot;&lt;/span&gt; &lt;span style="color:Gray;"&gt;-&lt;/span&gt;On_Click {
            Write&lt;span style="color:Gray;"&gt;-&lt;/span&gt;Host &lt;span style="color:#A31515;"&gt;&amp;quot;FullName:&amp;quot;&lt;/span&gt; &lt;span style="color:OrangeRed;"&gt;$FullName&lt;/span&gt;.Text
            Write&lt;span style="color:Gray;"&gt;-&lt;/span&gt;Host &lt;span style="color:#A31515;"&gt;&amp;quot;Prompt should be a ...StackPanel:&amp;quot;&lt;/span&gt; &lt;span style="color:OrangeRed;"&gt;$Prompt&lt;/span&gt;
            &lt;span style="color:OrangeRed;"&gt;$x&lt;/span&gt; &lt;span style="color:Gray;"&gt;=&lt;/span&gt; Set&lt;span style="color:Gray;"&gt;-&lt;/span&gt;UIValue &lt;span style="color:OrangeRed;"&gt;$Prompt&lt;/span&gt; &lt;span style="color:Gray;"&gt;-&lt;/span&gt;Passthru
            Write&lt;span style="color:Gray;"&gt;-&lt;/span&gt;Host &lt;span style="color:#A31515;"&gt;&amp;quot;X should be a ...StackPanel:&amp;quot;&lt;/span&gt; &lt;span style="color:OrangeRed;"&gt;$X&lt;/span&gt;
            Close&lt;span style="color:Gray;"&gt;-&lt;/span&gt;Control &lt;span style="color:OrangeRed;"&gt;$window&lt;/span&gt; &lt;span style="color:Green;"&gt;# I like to explicitly close the $window instead of the control&lt;/span&gt;
        }
    }
} &lt;span style="color:Gray;"&gt;-&lt;/span&gt;On_Loaded { &lt;span style="color:OrangeRed;"&gt;$FullName&lt;/span&gt;.Focus() } &lt;span style="color:Gray;"&gt;-&lt;/span&gt;Show 
&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;</description><author>Jaykul</author><pubDate>Sun, 19 May 2013 04:59:54 GMT</pubDate><guid isPermaLink="false">New Post: What am I doing wrong ? 20130519045954A</guid></item></channel></rss>