<?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>Development in a Blink &#187; WPK</title>
	<atom:link href="http://www.dougfinke.com/blog/index.php/category/wpk/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dougfinke.com/blog</link>
	<description>Researching the optimal; implementing the practical</description>
	<lastBuildDate>Fri, 03 May 2013 19:47:05 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>The Value Per Line of Code is Amazing</title>
		<link>http://www.dougfinke.com/blog/index.php/2011/07/17/the-value-per-line-of-code-is-amazing/</link>
		<comments>http://www.dougfinke.com/blog/index.php/2011/07/17/the-value-per-line-of-code-is-amazing/#comments</comments>
		<pubDate>Sun, 17 Jul 2011 13:27:58 +0000</pubDate>
		<dc:creator>Doug Finke</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[PowerBoots]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[ShowUI]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[WPK]]></category>

		<guid isPermaLink="false">http://www.dougfinke.com/blog/index.php/2011/07/17/the-value-per-line-of-code-is-amazing/</guid>
		<description><![CDATA[Learn how Wednesday July 20th I’ll be joining fellow ShowUI authors James Brundage and Joel “Jaykul” Bennett on the PowerScripting Podcast. ShowUI is a PowerShell module to help build WPF user interfaces in script. ShowUI makes the complicated world of WPF easy to use in PowerShell. You can use ShowUI to write simple WPF gadgets, [...]]]></description>
				<content:encoded><![CDATA[<h3>Learn how</h3>
<p>Wednesday July 20th I’ll be joining fellow <a href="http://showui.codeplex.com/">ShowUI</a> authors <a href="http://start-automating.com/">James Brundage</a> and <a href="http://huddledmasses.org/">Joel “Jaykul” Bennett</a> on the <a href="http://powerscripting.wordpress.com/">PowerScripting Podcast</a>.</p>
<p>ShowUI is a PowerShell module to help build WPF user interfaces in script. ShowUI makes the complicated world of WPF easy to use in PowerShell. You can use ShowUI to write simple WPF gadgets, quick front ends for your scripts, components, and full applications.</p>
<h3>Related </h3>
<ul>
<li>
<p>My&#160; MSDN article: <a href="http://msdn.microsoft.com/en-us/magazine/hh288074.aspx">Secrets to Building a WPF Application in Windows PowerShell</a></p>
</li>
<li>
<p>Post: <a href="http://www.dougfinke.com/blog/index.php/2011/06/26/powershell-showui-and-the-twitter-api/">PowerShell, ShowUI and the Twitter API</a> and video tutorial</p>
</li>
</ul>
<p> <object width="400" height="245"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=25626751&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=00adef&amp;fullscreen=1&amp;autoplay=0&amp;loop=0" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=25626751&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=00adef&amp;fullscreen=1&amp;autoplay=0&amp;loop=0" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="245"></embed></object>
<p>&#160;</p>
<ul>
<li>More videos on the <a href="http://showui.codeplex.com/documentation">ShowUI CodePlex page</a> </li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.dougfinke.com/blog/index.php/2011/07/17/the-value-per-line-of-code-is-amazing/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PowerShell, ShowUI and the Twitter API&#8211;Part 2</title>
		<link>http://www.dougfinke.com/blog/index.php/2011/07/09/powershell-showui-and-the-twitter-apipart-2/</link>
		<comments>http://www.dougfinke.com/blog/index.php/2011/07/09/powershell-showui-and-the-twitter-apipart-2/#comments</comments>
		<pubDate>Sat, 09 Jul 2011 15:24:39 +0000</pubDate>
		<dc:creator>Doug Finke</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[PowerBoots]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[Video Tutorial]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[WPK]]></category>

		<guid isPermaLink="false">http://www.dougfinke.com/blog/index.php/2011/07/09/powershell-showui-and-the-twitter-apipart-2/</guid>
		<description><![CDATA[Part 2 builds on the first 30 lines from PowerShell, ShowUI and the Twitter API–Part 1 (Check out the video tutorial for building it) and positions the script for the next set of steps. More updates coming soon. Updates This version lets you view multiple Twitter search feeds. Type in a search and press enter [...]]]></description>
				<content:encoded><![CDATA[<p>Part 2 builds on the first 30 lines from <a href="http://www.dougfinke.com/blog/index.php/2011/06/26/powershell-showui-and-the-twitter-api/">PowerShell, ShowUI and the Twitter API–Part 1</a> (Check out the <a href="http://vimeo.com/25626751">video tutorial</a> for building it) and positions the script for the next set of steps. </p>
<p>More updates coming soon. </p>
<p><a href="http://www.dougfinke.com/blog/wp-content/uploads/2011/07/image1.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto; padding-top: 0px" title="image" border="0" alt="image" src="http://www.dougfinke.com/blog/wp-content/uploads/2011/07/image_thumb1.png" width="614" height="309" /></a></p>
<h3>Updates</h3>
<p>This version lets you view multiple Twitter search feeds. Type in a search and press enter and another column is displayed. You can delete a column too.</p>
<h3>PowerShell Code</h3>
<p>Download it <a href="https://github.com/dfinke/powershell/blob/master/SearchTwitter/SearchTwitter.ps1">HERE</a> from my repository. Download <a href="http://showui.codeplex.com/">ShowUI</a>.</p>
<pre style="width: 585px; height: 1991px" class="PowerShellColorizedScript"><span style="color: #0000ff">Import-Module</span> <span style="color: #8a2be2">showui</span>            
            
<span style="color: #00008b">function</span> <span style="color: #8a2be2">Search-Twitter</span> <span style="color: #000000">{</span>            
    <span style="color: #00008b">param</span> <span style="color: #000000">(</span>             
        <span style="color: #a9a9a9">[</span><span style="color: #add8e6">Parameter</span><span style="color: #000000">(</span><span style="color: #000000">ValueFromPipeline</span><span style="color: #a9a9a9">=</span><span style="color: #ff4500">$true</span><span style="color: #000000">)</span><span style="color: #a9a9a9">]</span>            
        <span style="color: #ff4500">$query</span>            
    <span style="color: #000000">)</span>            
                
    <span style="color: #00008b">Begin</span> <span style="color: #000000">{</span> <span style="color: #ff4500">$wc</span> <span style="color: #a9a9a9">=</span> <span style="color: #0000ff">New-Object</span> <span style="color: #8a2be2">Net.Webclient</span> <span style="color: #000000">}</span>            
                
    <span style="color: #00008b">Process</span> <span style="color: #000000">{</span>            
        <span style="color: #ff4500">$url</span> <span style="color: #a9a9a9">=</span> <span style="color: #8b0000">&quot;http://search.twitter.com/search.rss?q=$query&quot;</span>            
        <span style="color: #000000">(</span><span style="color: #008080">[xml]</span><span style="color: #ff4500">$wc</span><span style="color: #a9a9a9">.</span><span style="color: #000000">downloadstring</span><span style="color: #000000">(</span><span style="color: #ff4500">$url</span><span style="color: #000000">)</span><span style="color: #000000">)</span><span style="color: #a9a9a9">.</span><span style="color: #000000">rss</span><span style="color: #a9a9a9">.</span><span style="color: #000000">channel</span><span style="color: #a9a9a9">.</span><span style="color: #000000">item</span> <span style="color: #a9a9a9">|</span>            
            <span style="color: #0000ff">Select</span> <span style="color: #8a2be2">*</span>            
    <span style="color: #000000">}</span>            
<span style="color: #000000">}</span>            
            
<span style="color: #00008b">function</span> <span style="color: #8a2be2">New-TwitterFeed</span> <span style="color: #000000">(</span><span style="color: #ff4500">$search</span><span style="color: #000000">)</span> <span style="color: #000000">{</span>            
            
    <span style="color: #ff4500">$guid</span> <span style="color: #a9a9a9">=</span> <span style="color: #8b0000">&quot;g&quot;</span> <span style="color: #a9a9a9">+</span> <span style="color: #008080">[guid]</span><span style="color: #a9a9a9">::</span><span style="color: #000000">NewGuid</span><span style="color: #000000">(</span><span style="color: #000000">)</span> <span style="color: #a9a9a9">-replace</span> <span style="color: #8b0000">&quot;-&quot;</span><span style="color: #a9a9a9">,</span><span style="color: #8b0000">&quot;&quot;</span>            
                
    <span style="color: #ff4500">$buttonAttributes</span> <span style="color: #a9a9a9">=</span> <span style="color: #000000">@{</span>            
        <span style="color: #000000">Margin</span> <span style="color: #a9a9a9">=</span> <span style="color: #800080">5</span>            
        <span style="color: #000000">HorizontalAlignment</span> <span style="color: #a9a9a9">=</span> <span style="color: #8b0000">&quot;Right&quot;</span>            
        <span style="color: #000000">Height</span> <span style="color: #a9a9a9">=</span> <span style="color: #800080">25</span>             
        <span style="color: #000000">Tag</span> <span style="color: #a9a9a9">=</span> <span style="color: #ff4500">$guid</span>             
    <span style="color: #000000">}</span>            
                
    <span style="color: #ff4500">$labelAttributes</span> <span style="color: #a9a9a9">=</span> <span style="color: #000000">@{</span>            
        <span style="color: #000000">FontSize</span> <span style="color: #a9a9a9">=</span> <span style="color: #800080">20</span>             
        <span style="color: #000000">Margin</span> <span style="color: #a9a9a9">=</span> <span style="color: #800080">5</span>             
        <span style="color: #000000">Foreground</span> <span style="color: #a9a9a9">=</span> <span style="color: #8b0000">&quot;White&quot;</span>            
    <span style="color: #000000">}</span>            
                
    <span style="color: #0000ff">Grid</span> <span style="color: #000080">-Name</span> <span style="color: #ff4500">$guid</span> <span style="color: #000080">-Rows</span> <span style="color: #800080">45</span><span style="color: #a9a9a9">,</span> <span style="color: #8a2be2">100*</span> <span style="color: #000080">-Tag</span> <span style="color: #ff4500">$search</span> <span style="color: #000000">{</span>            
        <span style="color: #0000ff">Grid</span> <span style="color: #000080">-Row</span> <span style="color: #800080">0</span> <span style="color: #000080">-Columns</span> <span style="color: #800080">2</span> <span style="color: #000000">{</span>                        
            <span style="color: #0000ff">Label</span> <span style="color: #000080">-Column</span> <span style="color: #800080">0</span> <span style="color: #ff4500">$Search</span> <span style="color: #ff4500">@labelAttributes</span>            
            <span style="color: #0000ff">Button</span> <span style="color: #8b0000">&quot; X &quot;</span> <span style="color: #000080">-Column</span> <span style="color: #800080">1</span> <span style="color: #ff4500">@buttonAttributes</span> <span style="color: #000080">-On_Click</span> <span style="color: #000000">{</span>            
                <span style="color: #ff4500">$name</span> <span style="color: #a9a9a9">=</span> <span style="color: #8b0000">&quot;`$$($this.tag)&quot;</span>            
                <span style="color: #ff4500">$targetLayout</span><span style="color: #a9a9a9">.</span><span style="color: #000000">Children</span><span style="color: #a9a9a9">.</span><span style="color: #000000">Remove</span><span style="color: #000000">(</span><span style="color: #000000">(</span><span style="color: #ff4500">$name</span><span style="color: #a9a9a9">|</span><span style="color: #0000ff">iex</span><span style="color: #000000">)</span><span style="color: #000000">)</span>                            
            <span style="color: #000000">}</span>            
        <span style="color: #000000">}</span>            
                    
        <span style="color: #0000ff">ListBox</span> <span style="color: #000080">-Background</span> <span style="color: #8a2be2">Black</span> <span style="color: #000080">-Row</span> <span style="color: #800080">1</span> <span style="color: #000080">-Margin</span> <span style="color: #800080">5</span> <span style="color: #000080">-DataContext</span> <span style="color: #000000">{</span>            
            <span style="color: #0000ff">Search-Twitter</span> <span style="color: #ff4500">$search</span>            
        <span style="color: #000000">}</span> <span style="color: #000080">-DataBinding</span> <span style="color: #000000">@{</span>            
            <span style="color: #000000">ItemsSource</span><span style="color: #a9a9a9">=</span><span style="color: #8b0000">&quot;.&quot;</span>            
        <span style="color: #000000">}</span> <span style="color: #000080">-ItemTemplate</span> <span style="color: #000000">{</span>            
            <span style="color: #ff4500">$tweetTbAttributes</span> <span style="color: #a9a9a9">=</span> <span style="color: #000000">@{</span>            
                <span style="color: #000000">FontSize</span> <span style="color: #a9a9a9">=</span> <span style="color: #800080">12</span>            
                <span style="color: #000000">Margin</span> <span style="color: #a9a9a9">=</span> <span style="color: #800080">5</span>             
                <span style="color: #000000">TextWrapping</span> <span style="color: #a9a9a9">=</span> <span style="color: #8b0000">&quot;wrap&quot;</span>            
                <span style="color: #000000">Foreground</span> <span style="color: #a9a9a9">=</span> <span style="color: #8b0000">&quot;White&quot;</span>            
            <span style="color: #000000">}</span>            
                                  
            <span style="color: #0000ff">Grid</span> <span style="color: #000080">-Columns</span> <span style="color: #800080">55</span><span style="color: #a9a9a9">,</span> <span style="color: #800080">300</span> <span style="color: #000000">{</span>            
                <span style="color: #0000ff">Image</span>     <span style="color: #000080">-Name</span> <span style="color: #8a2be2">Image</span>  <span style="color: #000080">-Column</span> <span style="color: #800080">0</span> <span style="color: #000080">-Margin</span> <span style="color: #800080">6</span>            
                <span style="color: #0000ff">TextBlock</span> <span style="color: #000080">-Name</span> <span style="color: #8a2be2">Title</span> <span style="color: #ff4500">@tweetTbAttributes</span> <span style="color: #000080">-Column</span> <span style="color: #800080">1</span>             
            <span style="color: #000000">}</span> <span style="color: #a9a9a9">|</span> <span style="color: #0000ff">ConvertTo-DataTemplate</span> <span style="color: #000080">-binding</span> <span style="color: #000000">@{</span>            
                <span style="color: #8b0000">&quot;Image.Source&quot;</span> <span style="color: #a9a9a9">=</span> <span style="color: #8b0000">&quot;image_link&quot;</span>            
                <span style="color: #8b0000">&quot;Title.Text&quot;</span> <span style="color: #a9a9a9">=</span> <span style="color: #8b0000">&quot;title&quot;</span>            
            <span style="color: #000000">}</span>            
        <span style="color: #000000">}</span>            
    <span style="color: #000000">}</span>            
<span style="color: #000000">}</span>            
            
<span style="color: #00008b">function</span> <span style="color: #8a2be2">ql</span> <span style="color: #000000">{</span><span style="color: #ff4500">$args</span><span style="color: #000000">}</span>            
            
<span style="color: #ff4500">$windowAttributes</span> <span style="color: #a9a9a9">=</span> <span style="color: #000000">@{</span>            
    <span style="color: #000000">WindowStartupLocation</span> <span style="color: #a9a9a9">=</span> <span style="color: #8b0000">&quot;CenterScreen&quot;</span>            
    <span style="color: #000000">Width</span> <span style="color: #a9a9a9">=</span> <span style="color: #800080">1200</span>            
    <span style="color: #000000">Height</span> <span style="color: #a9a9a9">=</span> <span style="color: #800080">600</span>            
    <span style="color: #000000">Background</span> <span style="color: #a9a9a9">=</span> <span style="color: #8b0000">&quot;Black&quot;</span>            
    <span style="color: #000000">Title</span> <span style="color: #a9a9a9">=</span> <span style="color: #8b0000">&quot;PowerShell, ShowUI and the Twitter API&quot;</span>            
<span style="color: #000000">}</span>            
            
<span style="color: #ff4500">$scrollViewerAttributes</span> <span style="color: #a9a9a9">=</span> <span style="color: #000000">@{</span>            
    <span style="color: #000000">VerticalScrollBarVisibility</span> <span style="color: #a9a9a9">=</span> <span style="color: #8b0000">&quot;Disabled&quot;</span>            
    <span style="color: #000000">HorizontalScrollBarVisibility</span> <span style="color: #a9a9a9">=</span> <span style="color: #8b0000">&quot;Auto&quot;</span>            
<span style="color: #000000">}</span>            
            
<span style="color: #ff4500">$textBboxAttributes</span> <span style="color: #a9a9a9">=</span> <span style="color: #000000">@{</span>            
    <span style="color: #000000">Margin</span> <span style="color: #a9a9a9">=</span> <span style="color: #800080">5</span>             
    <span style="color: #000000">Background</span> <span style="color: #a9a9a9">=</span> <span style="color: #8b0000">&quot;DarkGray &quot;</span>            
    <span style="color: #000000">Foreground</span> <span style="color: #a9a9a9">=</span> <span style="color: #8b0000">&quot;#FFFFFF&quot;</span>             
    <span style="color: #000000">FontSize</span> <span style="color: #a9a9a9">=</span> <span style="color: #800080">14</span>            
<span style="color: #000000">}</span>            
            
<span style="color: #0000ff">New-Window</span> <span style="color: #ff4500">@windowAttributes</span> <span style="color: #000080">-Show</span> <span style="color: #000080">-On_Loaded</span> <span style="color: #000000">{</span>            
    <span style="color: #ff4500">$search</span><span style="color: #a9a9a9">.</span><span style="color: #000000">focus</span><span style="color: #000000">(</span><span style="color: #000000">)</span>            
    <span style="color: #0000ff">ql</span> <span style="color: #8a2be2">PowerShell</span> <span style="color: #8a2be2">ShowUI</span> <span style="color: #8a2be2">dfinke</span> <span style="color: #8a2be2">jamesbru</span>  <span style="color: #8a2be2">jaykul</span> <span style="color: #a9a9a9">|</span>             
        <span style="color: #0000ff">ForEach</span> <span style="color: #000000">{</span>             
            <span style="color: #ff4500">$targetLayout</span><span style="color: #a9a9a9">.</span><span style="color: #000000">Children</span><span style="color: #a9a9a9">.</span><span style="color: #000000">Add</span><span style="color: #000000">(</span> <span style="color: #000000">(</span><span style="color: #0000ff">New-TwitterFeed</span> <span style="color: #ff4500">$_</span> <span style="color: #ff4500">$tabcontrol</span><span style="color: #000000">)</span> <span style="color: #000000">)</span>             
        <span style="color: #000000">}</span>            
<span style="color: #000000">}</span> <span style="color: #000000">{</span>            
    <span style="color: #0000ff">Grid</span> <span style="color: #000080">-Columns</span> <span style="color: #8a2be2">35*</span><span style="color: #a9a9a9">,</span> <span style="color: #800080">75</span> <span style="color: #000080">-Rows</span> <span style="color: #800080">35</span><span style="color: #a9a9a9">,</span> <span style="color: #8a2be2">100*</span> <span style="color: #000000">{</span>            
            
        <span style="color: #0000ff">TextBox</span> <span style="color: #000080">-Name</span> <span style="color: #8a2be2">Search</span> <span style="color: #000080">-Row</span> <span style="color: #800080">0</span> <span style="color: #000080">-Column</span> <span style="color: #800080">0</span> <span style="color: #ff4500">@textBboxAttributes</span>            
            
        <span style="color: #0000ff">Button</span> <span style="color: #000080">-IsDefault</span> <span style="color: #000080">-Row</span> <span style="color: #800080">0</span> <span style="color: #000080">-Column</span> <span style="color: #800080">1</span> <span style="color: #000080">-Margin</span> <span style="color: #800080">5</span> <span style="color: #8b0000">&quot;_Search&quot;</span> <span style="color: #000080">-On_Click</span> <span style="color: #000000">{</span>                        
            <span style="color: #ff4500">$targetLayout</span><span style="color: #a9a9a9">.</span><span style="color: #000000">Children</span><span style="color: #a9a9a9">.</span><span style="color: #000000">Add</span><span style="color: #000000">(</span> <span style="color: #000000">(</span><span style="color: #0000ff">New-TwitterFeed</span> <span style="color: #ff4500">$Search</span><span style="color: #a9a9a9">.</span><span style="color: #000000">Text</span><span style="color: #000000">)</span> <span style="color: #000000">)</span>            
            <span style="color: #ff4500">$Search</span><span style="color: #a9a9a9">.</span><span style="color: #000000">Text</span> <span style="color: #a9a9a9">=</span> <span style="color: #8b0000">&quot;&quot;</span>            
        <span style="color: #000000">}</span>            
            
        <span style="color: #0000ff">ScrollViewer</span> <span style="color: #000080">-Row</span> <span style="color: #800080">1</span> <span style="color: #000080">-Column</span> <span style="color: #800080">0</span> <span style="color: #000080">-ColumnSpan</span> <span style="color: #800080">2</span> <span style="color: #ff4500">@scrollViewerAttributes</span> <span style="color: #000000">{</span>            
            <span style="color: #0000ff">UniformGrid</span> <span style="color: #000080">-Name</span> <span style="color: #8a2be2">targetLayout</span> <span style="color: #000080">-Rows</span> <span style="color: #800080">1</span>            
        <span style="color: #000000">}</span>            
    <span style="color: #000000">}</span>            
<span style="color: #000000">}</span></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.dougfinke.com/blog/index.php/2011/07/09/powershell-showui-and-the-twitter-apipart-2/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>PowerShell Clock with ShowUI</title>
		<link>http://www.dougfinke.com/blog/index.php/2011/07/07/powershell-clock-with-showui/</link>
		<comments>http://www.dougfinke.com/blog/index.php/2011/07/07/powershell-clock-with-showui/#comments</comments>
		<pubDate>Fri, 08 Jul 2011 01:26:42 +0000</pubDate>
		<dc:creator>Doug Finke</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[PowerBoots]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Video Tutorial]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[WPK]]></category>

		<guid isPermaLink="false">http://www.dougfinke.com/blog/index.php/2011/07/07/powershell-clock-with-showui/</guid>
		<description><![CDATA[Richard Siddaway posted A PowerShell Clock using WPF and demonstrated some nice features. A windowless window Ticking digital clock Moving the window by clicking and dragging even though it doesn’t have a border The ShowUI Code Here is the ShowUI code. Note the On_* keys in the hash table. They handle the mouse button events [...]]]></description>
				<content:encoded><![CDATA[<p>Richard Siddaway posted <a href="http://msmvps.com/blogs/richardsiddaway/archive/2011/07/07/a-powershell-clock.aspx">A PowerShell Clock</a> using WPF and demonstrated some nice features.</p>
<ul>
<li>A windowless window</li>
<li>Ticking digital clock</li>
<li>Moving the window by clicking and dragging even though it doesn’t have a border</li>
</ul>
<p><a href="http://www.dougfinke.com/blog/wp-content/uploads/2011/07/image.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto; padding-top: 0px" title="image" border="0" alt="image" src="http://www.dougfinke.com/blog/wp-content/uploads/2011/07/image_thumb.png" width="240" height="67" /></a></p>
<h3>The ShowUI Code</h3>
<p>Here is the <a href="http://showui.codeplex.com/">ShowUI</a> code. Note the On_* keys in the hash table. They handle the mouse button events and the windows load event where I register a PowerShell script block that executes every half a second. This updates the time and enables the ticking digital clock.</p>
<p>Richard’s solution has the advantage that he can deploy it and it should work on any windows system that has the latest .NET runtime. </p>
<p>My solution requires the ShowUI module to be installed on the target machine.</p>
<p>The advantages to my solution, IMHO, are no XAML, increased value per line of code and it’s all PowerShell.</p>
<p>Check out both solutions and <a href="http://showui.codeplex.com/">ShowUI</a>.</p>
<pre style="width: 583px; height: 674px" class="PowerShellColorizedScript"><span style="color: #0000ff">Import-Module</span> <span style="color: #8a2be2">ShowUI</span>            
            
<span style="color: #ff4500">$windowAttributes</span> <span style="color: #a9a9a9">=</span> <span style="color: #000000">@{</span>            
    <span style="color: #000000">WindowStartupLocation</span> <span style="color: #a9a9a9">=</span> <span style="color: #8b0000">&quot;CenterScreen&quot;</span>            
    <span style="color: #000000">SizeToContent</span> <span style="color: #a9a9a9">=</span> <span style="color: #8b0000">&quot;WidthAndHeight&quot;</span>             
    <span style="color: #000000">WindowStyle</span> <span style="color: #a9a9a9">=</span> <span style="color: #8b0000">&quot;None&quot;</span>            
    <span style="color: #000000">Background</span> <span style="color: #a9a9a9">=</span> <span style="color: #8b0000">&quot;Transparent &quot;</span>            
            
    <span style="color: #000000">On_MouseRightButtonDown</span> <span style="color: #a9a9a9">=</span> <span style="color: #000000">{</span> <span style="color: #0000ff">Close-Control</span><span style="color: #000000">}</span>             
    <span style="color: #000000">On_MouseLeftButtonDown</span>  <span style="color: #a9a9a9">=</span> <span style="color: #000000">{</span> <span style="color: #ff4500">$_</span><span style="color: #a9a9a9">.</span><span style="color: #000000">Handled</span> <span style="color: #a9a9a9">=</span> <span style="color: #ff4500">$true</span><span style="color: #000000">;</span><span style="color: #ff4500">$window</span><span style="color: #a9a9a9">.</span><span style="color: #000000">DragMove</span><span style="color: #000000">(</span><span style="color: #000000">)</span> <span style="color: #000000">}</span>            
    <span style="color: #000000">On_Loaded</span> <span style="color: #a9a9a9">=</span> <span style="color: #000000">{</span>            
        <span style="color: #0000ff">Register-PowerShellCommand</span> <span style="color: #000080">-ScriptBlock</span> <span style="color: #000000">{</span>            
            <span style="color: #ff4500">$window</span><span style="color: #a9a9a9">.</span><span style="color: #000000">Content</span><span style="color: #a9a9a9">.</span><span style="color: #000000">Content</span> <span style="color: #a9a9a9">=</span> <span style="color: #000000">(</span><span style="color: #0000ff">Get-Date</span><span style="color: #000000">)</span><span style="color: #a9a9a9">.</span><span style="color: #000000">ToString</span><span style="color: #000000">(</span><span style="color: #8b0000">&quot;T&quot;</span><span style="color: #000000">)</span>            
        <span style="color: #000000">}</span> <span style="color: #000080">-Run</span> <span style="color: #000080">-In</span> <span style="color: #8b0000">&quot;0:0:0.5&quot;</span>            
    <span style="color: #000000">}</span>            
<span style="color: #000000">}</span>            
            
<span style="color: #ff4500">$labelAttributes</span> <span style="color: #a9a9a9">=</span> <span style="color: #000000">@{</span>            
    <span style="color: #000000">Content</span> <span style="color: #a9a9a9">=</span> <span style="color: #000000">(</span><span style="color: #0000ff">Get-Date</span><span style="color: #000000">)</span><span style="color: #a9a9a9">.</span><span style="color: #000000">ToString</span><span style="color: #000000">(</span><span style="color: #8b0000">&quot;T&quot;</span><span style="color: #000000">)</span>            
    <span style="color: #000000">FontFamily</span> <span style="color: #a9a9a9">=</span> <span style="color: #8b0000">&quot;Impact, Arial&quot;</span>            
    <span style="color: #000000">FontWeight</span> <span style="color: #a9a9a9">=</span> <span style="color: #800080">800</span>            
    <span style="color: #000000">FontSize</span> <span style="color: #a9a9a9">=</span> <span style="color: #800080">90</span>             
<span style="color: #000000">}</span>            
            
<span style="color: #0000ff">New-Window</span> <span style="color: #ff4500">@windowAttributes</span> <span style="color: #000080">-AllowsTransparency</span> <span style="color: #000080">-Show</span>  <span style="color: #000000">{</span>            
    <span style="color: #0000ff">Label</span> <span style="color: #ff4500">@labelAttributes</span> <span style="color: #000080">-Name</span> <span style="color: #8a2be2">Clock</span> <span style="color: #000080">-Foreground</span> <span style="color: #000000">(</span>            
        <span style="color: #0000ff">LinearGradientBrush</span> <span style="color: #000000">$(</span>            
            <span style="color: #0000ff">GradientStop</span> <span style="color: #000080">-Color</span> <span style="color: #8a2be2">Red</span>    <span style="color: #000080">-Offset</span> <span style="color: #800080">1</span>            
            <span style="color: #0000ff">GradientStop</span> <span style="color: #000080">-Color</span> <span style="color: #8a2be2">Orange</span> <span style="color: #000080">-Offset</span> <span style="color: #800080">0.85</span>            
            <span style="color: #0000ff">GradientStop</span> <span style="color: #000080">-Color</span> <span style="color: #8a2be2">Yellow</span> <span style="color: #000080">-Offset</span> <span style="color: #800080">0.7</span>            
            <span style="color: #0000ff">GradientStop</span> <span style="color: #000080">-Color</span> <span style="color: #8a2be2">Green</span>  <span style="color: #000080">-Offset</span> <span style="color: #800080">0.55</span>            
            <span style="color: #0000ff">GradientStop</span> <span style="color: #000080">-Color</span> <span style="color: #8a2be2">Blue</span>   <span style="color: #000080">-Offset</span> <span style="color: #800080">0.4</span>            
            <span style="color: #0000ff">GradientStop</span> <span style="color: #000080">-Color</span> <span style="color: #8a2be2">Indigo</span> <span style="color: #000080">-Offset</span> <span style="color: #800080">0.2</span>            
            <span style="color: #0000ff">GradientStop</span> <span style="color: #000080">-Color</span> <span style="color: #8a2be2">Violet</span> <span style="color: #000080">-Offset</span> <span style="color: #800080">0</span>            
        <span style="color: #000000">)</span>            
    <span style="color: #000000">)</span>            
<span style="color: #000000">}</span></pre>
<h3>Related Topics</h3>
<ul>
<li>My “Hello World” <a href="http://www.dougfinke.com/blog/index.php/2011/06/14/powershell-showui-video-tutorialhello-world/">video tutorial</a> of ShowUI</li>
<li><a href="http://www.dougfinke.com/blog/index.php/2011/06/26/powershell-showui-and-the-twitter-api/">PowerShell, ShowUI and the Twitter API</a></li>
<li>Other ShowUI <a href="http://www.youtube.com/user/StartAutomating">video tutorials</a> from James Brundage, one of the authors of ShowUI</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.dougfinke.com/blog/index.php/2011/07/07/powershell-clock-with-showui/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Secrets to Building a WPF Application in Windows PowerShell</title>
		<link>http://www.dougfinke.com/blog/index.php/2011/07/05/secrets-to-building-a-wpf-application-in-windows-powershell/</link>
		<comments>http://www.dougfinke.com/blog/index.php/2011/07/05/secrets-to-building-a-wpf-application-in-windows-powershell/#comments</comments>
		<pubDate>Tue, 05 Jul 2011 10:57:25 +0000</pubDate>
		<dc:creator>Doug Finke</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[PowerBoots]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[ShowUI]]></category>
		<category><![CDATA[Video Tutorial]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[WPK]]></category>

		<guid isPermaLink="false">http://www.dougfinke.com/blog/index.php/2011/07/05/secrets-to-building-a-wpf-application-in-windows-powershell/</guid>
		<description><![CDATA[Check out my MSDN Article on PowerShell and WPF: Secrets to Building a WPF Application in Windows PowerShell Special bonus Windows PowerShell creator Jeffrey Snover weighs in on the Ad Hoc development model and origin of the language. Related Topics ShowUI: Write-UI –in PowerShell – A PowerShell module to help build WPF user interfaces in [...]]]></description>
				<content:encoded><![CDATA[<p>Check out my MSDN Article on PowerShell and WPF:</p>
<h3><a href="http://msdn.microsoft.com/en-us/magazine/hh288074.aspx">Secrets to Building a WPF Application in Windows PowerShell</a></h3>
<h3>Special bonus</h3>
<p>Windows PowerShell creator Jeffrey Snover weighs in on the Ad Hoc development model and origin of the language.</p>
<h3>Related Topics</h3>
<ul>
<li><a href="http://showui.codeplex.com/">ShowUI: Write-UI –in PowerShell</a> – A PowerShell module to help build WPF user interfaces in script</li>
<li>My “Hello World” video tutorial of <a href="http://showui.codeplex.com/">ShowUI</a></li>
<li><a href="http://www.dougfinke.com/blog/index.php/2011/06/26/powershell-showui-and-the-twitter-api/">PowerShell, ShowUI and the Twitter API</a></li>
<li>Other ShowUI <a href="http://www.youtube.com/user/StartAutomating">video tutorials</a> from James Brundage, one of the authors of ShowUI</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.dougfinke.com/blog/index.php/2011/07/05/secrets-to-building-a-wpf-application-in-windows-powershell/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>My MSDN Magazine article is out&#8211;PowerShell &amp; WPF</title>
		<link>http://www.dougfinke.com/blog/index.php/2011/07/01/my-msdn-magazine-article-is-outpowershell-wpf-2/</link>
		<comments>http://www.dougfinke.com/blog/index.php/2011/07/01/my-msdn-magazine-article-is-outpowershell-wpf-2/#comments</comments>
		<pubDate>Fri, 01 Jul 2011 22:32:49 +0000</pubDate>
		<dc:creator>Doug Finke</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[MSDN]]></category>
		<category><![CDATA[MSDN Magazine]]></category>
		<category><![CDATA[PowerBoots]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[ShowUI]]></category>
		<category><![CDATA[WPK]]></category>

		<guid isPermaLink="false">http://www.dougfinke.com/blog/index.php/2011/07/01/my-msdn-magazine-article-is-outpowershell-wpf-2/</guid>
		<description><![CDATA[Secrets to Building a WPF Application in Windows PowerShell Thank You I want to thank Jeffrey Snover, Distinguished Engineer, Lead Architect for Windows Server and father of PowerShell. He eagerly and graciously agreed to write the sidebar for the article and offered great feedback. Also, thank you to James Brundage, founder and lead developer of [...]]]></description>
				<content:encoded><![CDATA[<h3><a href="http://msdn.microsoft.com/en-us/magazine/hh288074.aspx">Secrets to Building a WPF Application in Windows PowerShell</a></h3>
<h3>Thank You</h3>
<p>I want to thank Jeffrey Snover, Distinguished Engineer, Lead Architect for Windows Server and father of PowerShell. He eagerly and graciously agreed to write the sidebar for the article and offered great feedback.</p>
<p>Also, thank you to James Brundage, founder and lead developer of <a href="http://start-automating.com/">Start-Automating</a>, creator of the <a href="http://archive.msdn.microsoft.com/PowerShellPack">PowerShell Pack and WPK</a>. He provided excellent insight on my drafts. Hat tip to Joel Bennet, author of PowerBoots.</p>
<p>Finally, thank you to my colleagues who took the time to read and offer suggestions.</p>
<h3><a href="http://showui.codeplex.com/">ShowUI: Write-UI –in PowerShell</a></h3>
<p>While the article was going through technical and copy editing, the authors of WPK and PowerBoots merged the two frameworks, <a href="http://www.dougfinke.com/blog/index.php/2011/06/06/wpk-powerboots-powershell-showui/">WPK + PowerBoots =&gt; PowerShell ShowUI</a>. </p>
<h3>Video Tutorials</h3>
<p>I put together a “Hello World” demo of <a href="http://showui.codeplex.com/">ShowUI</a>. Plus this post <a href="http://www.dougfinke.com/blog/index.php/2011/06/26/powershell-showui-and-the-twitter-api/">PowerShell, ShowUI and the Twitter API</a>.</p>
<p align="center"><object width="400" height="245"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=24989541&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=00adef&amp;fullscreen=1&amp;autoplay=0&amp;loop=0" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=24989541&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=00adef&amp;fullscreen=1&amp;autoplay=0&amp;loop=0" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="245"></embed></object></p>
<p align="center">
<p>Definitely check out these other ShowUI <a href="http://www.youtube.com/user/StartAutomating">video tutorials</a>.</p>
<h3>Updated PowerShell Script for the Article </h3>
<p>Here is the <a href="http://showui.codeplex.com/">ShowUI</a> version of the PowerShell script I did in the MSDN article.</p>
<p> <iframe style="padding-bottom: 0px; background-color: #fcfcfc; padding-left: 0px; width: 98px; padding-right: 0px; height: 115px; padding-top: 0px" title="Preview" marginheight="0" src="https://skydrive.live.com/embedicon.aspx/PresentValueCalculator?cid=5dec3b62d9308943&amp;sc=documents" frameborder="0" marginwidth="0" scrolling="no"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dougfinke.com/blog/index.php/2011/07/01/my-msdn-magazine-article-is-outpowershell-wpf-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PowerShell ShowUI Video Tutorial&#8211;Hello World</title>
		<link>http://www.dougfinke.com/blog/index.php/2011/06/14/powershell-showui-video-tutorialhello-world/</link>
		<comments>http://www.dougfinke.com/blog/index.php/2011/06/14/powershell-showui-video-tutorialhello-world/#comments</comments>
		<pubDate>Tue, 14 Jun 2011 23:20:19 +0000</pubDate>
		<dc:creator>Doug Finke</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[ShowUI]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Video Tutorial]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[WPK]]></category>

		<guid isPermaLink="false">http://www.dougfinke.com/blog/index.php/2011/06/14/powershell-showui-video-tutorialhello-world/</guid>
		<description><![CDATA[I put together this short tutorial using ShowUI (download ShowUI HERE). ShowUI is a PowerShell module to help build WPF user interfaces in script. You can use ShowUI to write simple WPF gadgets, quick front ends for your scripts, components, and full applications. Basic Building Blocks In the video I demo the basic building blocks [...]]]></description>
				<content:encoded><![CDATA[<p align="left">I put together this short tutorial using ShowUI (download ShowUI <a href="http://showui.codeplex.com/">HERE</a>). ShowUI is a PowerShell module to help build WPF user interfaces in script. You can use ShowUI to write simple WPF gadgets, quick front ends for your scripts, components, and full applications.</p>
<h3 align="left">Basic Building Blocks</h3>
<p align="left">In the video I demo the basic building blocks you’ll reuse over and over. New-Window, New-StackPanel, New-Label, New-Button and more.</p>
<p align="left">Take a look and let me know what questions you’d liked answered. I’ll include them in the next set of video tutorials.</p>
<p align="center"><object width="400" height="245"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=24989541&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=00adef&amp;fullscreen=1&amp;autoplay=0&amp;loop=0" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=24989541&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=00adef&amp;fullscreen=1&amp;autoplay=0&amp;loop=0" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="245"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dougfinke.com/blog/index.php/2011/06/14/powershell-showui-video-tutorialhello-world/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>WPK + PowerBoots =&gt; PowerShell ShowUI</title>
		<link>http://www.dougfinke.com/blog/index.php/2011/06/06/wpk-powerboots-powershell-showui/</link>
		<comments>http://www.dougfinke.com/blog/index.php/2011/06/06/wpk-powerboots-powershell-showui/#comments</comments>
		<pubDate>Tue, 07 Jun 2011 00:17:27 +0000</pubDate>
		<dc:creator>Doug Finke</dc:creator>
				<category><![CDATA[GUI]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[PowerBoots]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Shoes]]></category>
		<category><![CDATA[ShowUI]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[WPK]]></category>

		<guid isPermaLink="false">http://www.dougfinke.com/blog/index.php/2011/06/06/wpk-powerboots-powershell-showui/</guid>
		<description><![CDATA[Version 1.0 is up on CodePlex HERE. ShowUI is a PowerShell module to help build WPF user interfaces in script. ShowUI makes the complicated world of WPF easy to use in PowerShell. You can use ShowUI to write simple WPF gadgets, quick front ends for your scripts, components, and full applications. History Back in 2008 [...]]]></description>
				<content:encoded><![CDATA[<p>Version 1.0 is up on CodePlex <a href="http://showui.codeplex.com/">HERE</a>.</p>
<blockquote><p><a href="http://showui.codeplex.com/">ShowUI</a> is a PowerShell module to help build WPF user interfaces in script. <a href="http://showui.codeplex.com/">ShowUI</a> makes the complicated world of WPF easy to use in PowerShell. You can use <a href="http://showui.codeplex.com/">ShowUI</a> to write simple WPF gadgets, quick front ends for your scripts, components, and full applications.</p>
</blockquote>
<h3>History</h3>
<p>Back in 2008 I blogged about <a href="http://www.dougfinke.com/blog/index.php/2008/03/25/ruby-shoes-and-the-start-of-a-powershell-version/">Ruby Shoes and the start of a PowerShell version</a>. Shoes is a GUI framework for Ruby. I figured why not a WinForms GUI framework for PowerShell. </p>
<p>Here is the Ruby Shoes example in <a href="http://showui.codeplex.com/">ShowUI</a> today:</p>
<p><a href="http://www.dougfinke.com/blog/wp-content/uploads/2011/06/image.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto; padding-top: 0px" title="image" border="0" alt="image" src="http://www.dougfinke.com/blog/wp-content/uploads/2011/06/image_thumb.png" width="505" height="261" /></a></p>
<p><a href="http://huddledmasses.org/">Joel ‘Jaykul’ Bennett</a> figured the same, but using WPF,&#160; leaving a comment on my post about working on something he called PowerBoots.</p>
<p>Meanwhile James Brundage, founder of <a href="http://www.start-automating.com/">Start-Automating</a> and former member of the Microsoft PowerShell Team, was working on WPK, that was released as the part of the <a href="http://archive.msdn.microsoft.com/PowerShellPack">PowerShell Pack</a>.</p>
<p>I was lucky enough to get an early look at both of these excellent frameworks. These two powerhouse PowerShell guys decided to merge them, taking the best of both and kicking it up a notch. Once again, I am lucky enough to be involved, hear the discussions and contribute to the project.</p>
<h3>CodePlex Projects</h3>
<p>Here are two other WPF/PowerBoots projects I have. I’ll be doing more blogs and updating these projects to <a href="http://showui.codeplex.com/">ShowUI</a> soon.</p>
<ul>
<li><a href="http://trypowershell.codeplex.com/">Try PowerShell</a> </li>
<li><a href="http://psodata.codeplex.com/">OData PowerShell Explorer</a> </li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.dougfinke.com/blog/index.php/2011/06/06/wpk-powerboots-powershell-showui/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How To: Find what PowerShell Functions are in what files and/or modules</title>
		<link>http://www.dougfinke.com/blog/index.php/2011/03/09/how-to-find-what-powershell-functions-are-in-what-files-andor-modules/</link>
		<comments>http://www.dougfinke.com/blog/index.php/2011/03/09/how-to-find-what-powershell-functions-are-in-what-files-andor-modules/#comments</comments>
		<pubDate>Thu, 10 Mar 2011 00:53:08 +0000</pubDate>
		<dc:creator>Doug Finke</dc:creator>
				<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[PowerShell Modules]]></category>
		<category><![CDATA[PowerShell Pack]]></category>
		<category><![CDATA[PowerShell Pearls]]></category>
		<category><![CDATA[WPK]]></category>

		<guid isPermaLink="false">http://www.dougfinke.com/blog/index.php/2011/03/09/how-to-find-what-powershell-functions-are-in-what-files-andor-modules/</guid>
		<description><![CDATA[As you create larger and larger PowerShell scripts, developing the habit of organizing them into separate files and modules is important for two reasons. Managing complexity and maintaining the ability to reason about what you’ve built. One system I wrote contained: 105 PowerShell script files 151 functions Over 4 KLOCs (read Kay-Locks, meaning 4,000 lines [...]]]></description>
				<content:encoded><![CDATA[<p>As you create larger and larger PowerShell scripts, developing the habit of organizing them into separate files and modules is important for two reasons. Managing complexity and maintaining the ability to reason about what you’ve built.</p>
<p>One system I wrote contained:</p>
<ul>
<li>105 PowerShell script files </li>
<li>151 functions </li>
<li>Over 4 KLOCs (read Kay-Locks, meaning 4,000 lines of code).&#160; </li>
</ul>
<p>Compared to the <a href="http://archive.msdn.microsoft.com/PowerShellPack">PowerShell Pack</a> WPK set of scripts having:</p>
<ul>
<li>73 files </li>
<li>722 functions </li>
<li>More than 100 KLOCs </li>
</ul>
<p>Maybe you keep your scripts in separate directory and each are for a different task.</p>
<h3>Select-String &#8211; Finds text in strings and files</h3>
<p>While Select-String is a useful and must know cmdlet, if searching for a function name you will find that name when it is contained in a comment or random string. Sometimes you don’t want to see that.</p>
<h3>Get-Function Finds and Returns Only Function Names</h3>
<p>Get-Function searches all PowerShell files from the current directory and <strong><u>returns only function names</u></strong>. Plus, you can provide a partial name and Get-Function will do a match. The following output is the result of running Get-Function in the $PSHOME\Modules\PSDiagnostics directory.</p>
<pre style="width: 490px; height: 238px" class="PowerShellColorizedScript"><span style="color: #8b0000">FunctionName                 FileName                     Line
------------                 --------                     ----
Start-Trace                  C:\Windows\System32\Wind...    20
Stop-Trace                   C:\Windows\System32\Wind...    96
Enable-WSManTrace            C:\Windows\System32\Wind...   122
Disable-WSManTrace           C:\Windows\System32\Wind...   152
Enable-PSWSManCombinedTrace  C:\Windows\System32\Wind...   157
Disable-PSWSManCombinedTrace C:\Windows\System32\Wind...   179
Set-LogProperties            C:\Windows\System32\Wind...   184
ConvertTo-Bool               C:\Windows\System32\Wind...   223
Get-LogProperties            C:\Windows\System32\Wind...   235
Enable-PSTrace               C:\Windows\System32\Wind...   262
Disable-PSTrace              C:\Windows\System32\Wind...   269</span></pre>
<h3>The Script</h3>
<p>Get-Function recursively searches from the current directory (the default that can be overridden), then uses the PowerShell <em>tokenizer </em>(see line 8 )<em>&#160;</em>to select only script statements that are functions and returns the name of that function (see lines 13 and 14). It creates and emits to the pipeline a PSObject that holds the FileName, FunctionName and Line Number. Finally, the where cmdlet is used to filter only the function names you’d like, if provided.</p>
<p>As with other PowerShell output, the results from Get-Function can be saved to a file, piped to <em>Out-GridView </em>or piped to other cmdlets like Group-Object.</p>
<pre class="PowerShellColorizedScript"><span style="color: #00008b">Function</span> <span style="color: #8a2be2">Get-Function</span> <span style="color: #000000">(</span><span style="color: #ff4500">$pattern</span><span style="color: #a9a9a9">,</span> <span style="color: #ff4500">$path</span><span style="color: #a9a9a9">=</span><span style="color: #8b0000">&quot;$pwd&quot;</span><span style="color: #000000">)</span> <span style="color: #000000">{</span>            
             
 <span style="color: #ff4500">$parser</span>  <span style="color: #a9a9a9">=</span> <span style="color: #008080">[System.Management.Automation.PSParser]</span>            
             
 <span style="color: #0000ff">Get-ChildItem</span> <span style="color: #ff4500">$path</span> <span style="color: #000080">-Recurse</span> <span style="color: #000080">-Include</span> <span style="color: #8a2be2">*.ps1</span><span style="color: #a9a9a9">,</span> <span style="color: #8a2be2">*.psm1</span> <span style="color: #a9a9a9">|</span> <span style="color: #0000ff">ForEach</span> <span style="color: #000000">{</span>             
             
   <span style="color: #ff4500">$content</span> <span style="color: #a9a9a9">=</span> <span style="color: #008080">[IO.File]</span><span style="color: #a9a9a9">::</span><span style="color: #000000">ReadAllText</span><span style="color: #000000">(</span><span style="color: #ff4500">$_</span><span style="color: #a9a9a9">.</span><span style="color: #000000">FullName</span><span style="color: #000000">)</span>            
   <span style="color: #ff4500">$tokens</span>  <span style="color: #a9a9a9">=</span> <span style="color: #ff4500">$parser</span><span style="color: #a9a9a9">::</span><span style="color: #000000">Tokenize</span><span style="color: #000000">(</span><span style="color: #ff4500">$content</span><span style="color: #a9a9a9">,</span> <span style="color: #008080">[ref]</span> <span style="color: #ff4500">$null</span><span style="color: #000000">)</span>            
   <span style="color: #ff4500">$count</span>   <span style="color: #a9a9a9">=</span> <span style="color: #ff4500">$tokens</span><span style="color: #a9a9a9">.</span><span style="color: #000000">Count</span>             
                   
   <span style="color: #000000">$(</span>            
       <span style="color: #00008b">for</span><span style="color: #000000">(</span><span style="color: #ff4500">$idx</span><span style="color: #a9a9a9">=</span><span style="color: #800080">0</span><span style="color: #000000">;</span> <span style="color: #ff4500">$idx</span> <span style="color: #a9a9a9">-lt</span> <span style="color: #ff4500">$count</span><span style="color: #000000">;</span> <span style="color: #ff4500">$idx</span> <span style="color: #a9a9a9">+=</span> <span style="color: #800080">1</span><span style="color: #000000">)</span> <span style="color: #000000">{</span>            
            <span style="color: #00008b">if</span><span style="color: #000000">(</span><span style="color: #ff4500">$tokens</span><span style="color: #a9a9a9">[</span><span style="color: #ff4500">$idx</span><span style="color: #a9a9a9">]</span><span style="color: #a9a9a9">.</span><span style="color: #000000">Content</span> <span style="color: #a9a9a9">-eq</span> <span style="color: #8b0000">'function'</span><span style="color: #000000">)</span> <span style="color: #000000">{</span>            
                <span style="color: #ff4500">$targetToken</span> <span style="color: #a9a9a9">=</span> <span style="color: #ff4500">$tokens</span><span style="color: #a9a9a9">[</span><span style="color: #ff4500">$idx</span><span style="color: #a9a9a9">+</span><span style="color: #800080">1</span><span style="color: #a9a9a9">]</span>            
                <span style="color: #0000ff">New-Object</span> <span style="color: #8a2be2">PSObject</span> <span style="color: #000080">-Property</span> <span style="color: #000000">@{</span>            
                   <span style="color: #000000">FileName</span> <span style="color: #a9a9a9">=</span> <span style="color: #ff4500">$_</span><span style="color: #a9a9a9">.</span><span style="color: #000000">FullName</span>            
                   <span style="color: #000000">FunctionName</span> <span style="color: #a9a9a9">=</span> <span style="color: #ff4500">$targetToken</span><span style="color: #a9a9a9">.</span><span style="color: #000000">Content</span>             
                   <span style="color: #000000">Line</span> <span style="color: #a9a9a9">=</span> <span style="color: #ff4500">$targetToken</span><span style="color: #a9a9a9">.</span><span style="color: #000000">StartLine</span>            
                <span style="color: #000000">}</span> <span style="color: #a9a9a9">|</span> <span style="color: #0000ff">Select</span> <span style="color: #8a2be2">FunctionName</span><span style="color: #a9a9a9">,</span> <span style="color: #8a2be2">FileName</span><span style="color: #a9a9a9">,</span> <span style="color: #8a2be2">Line</span>            
            <span style="color: #000000">}</span>            
       <span style="color: #000000">}</span>             
   <span style="color: #000000">)</span> <span style="color: #a9a9a9">|</span> <span style="color: #0000ff">Where</span> <span style="color: #000000">{</span><span style="color: #ff4500">$_</span><span style="color: #a9a9a9">.</span><span style="color: #000000">FunctionName</span> <span style="color: #a9a9a9">-match</span> <span style="color: #ff4500">$pattern</span><span style="color: #000000">}</span>            
 <span style="color: #000000">}</span>            
<span style="color: #000000">}</span></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.dougfinke.com/blog/index.php/2011/03/09/how-to-find-what-powershell-functions-are-in-what-files-andor-modules/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>NYC Code Camp PowerShell Talk</title>
		<link>http://www.dougfinke.com/blog/index.php/2011/02/21/nyc-code-camp-powershell-talk/</link>
		<comments>http://www.dougfinke.com/blog/index.php/2011/02/21/nyc-code-camp-powershell-talk/#comments</comments>
		<pubDate>Mon, 21 Feb 2011 23:37:25 +0000</pubDate>
		<dc:creator>Doug Finke</dc:creator>
				<category><![CDATA[Code Camp]]></category>
		<category><![CDATA[Excel]]></category>
		<category><![CDATA[geekSpeak]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[NYC Code Camp]]></category>
		<category><![CDATA[OData]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[PowerShell Pearls]]></category>
		<category><![CDATA[Windows PowerShell]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[WPK]]></category>

		<guid isPermaLink="false">http://www.dougfinke.com/blog/index.php/2011/02/21/nyc-code-camp-powershell-talk/</guid>
		<description><![CDATA[I presented at the NYC Code Camp 2011 along with my Lab49 colleagues David Padbury, Jimmy Schementi and Scott Weinstein. My talk was on PowerShell for .NET Developers. Here is a recording I did on that topic for Microsoft Channel 9 geekSpeak. The attendees were great. Of the 50+, all heard about PowerShell and a [...]]]></description>
				<content:encoded><![CDATA[<p>I presented at the <a href="http://channel9.msdn.com/shows/geekSpeak/geekSpeak-Recording-PowerShell-for-NET-Developers-with-Doug-Finke/">NYC Code Camp 2011</a> along with my <a href="http://www.lab49.com/">Lab49</a> colleagues <a href="http://blog.davidpadbury.com/">David Padbury</a>, <a href="http://blog.jimmy.schementi.com/">Jimmy Schementi</a> and <a href="http://weblogs.asp.net/SWeinstein/">Scott Weinstein</a>.</p>
<p>My talk was on PowerShell for .NET Developers. Here is a recording I did on that topic for <a href="http://channel9.msdn.com/shows/geekSpeak/geekSpeak-Recording-PowerShell-for-NET-Developers-with-Doug-Finke/">Microsoft Channel 9 geekSpeak</a>.</p>
<p>The attendees were great. Of the 50+, all heard about PowerShell and a few were using it in Production.</p>
<h3>The questions went deep too:</h3>
<ul>
<li><em><strong>Can you embed PowerShell in a C# app?</strong></em> </li>
<ul>
<li><a href="http://www.dougfinke.com/blog/index.php/2009/09/02/how-to-host-powershell-in-a-wpf-application/">How to Host PowerShell in a WPF Application</a></li>
</ul>
<li><strong><em>Does it work with OData</em>?</strong> </li>
<ul>
<li><a href="http://www.dougfinke.com/blog/index.php/2010/03/28/powershell-wpk-netflix-viewer-using-microsofts-odata/">PowerShell WPK NetFlix Viewer Using Microsoft’s OData</a></li>
<li><a href="http://www.dougfinke.com/blog/index.php/2010/08/18/doug-finke-on-the-odata-powershell-explorer/">OData PowerShell Explorer</a></li>
</ul>
<li><em><strong>Can you automate Excel with PowerShell?</strong></em></li>
<ul>
<li><a href="http://www.dougfinke.com/blog/index.php/2009/06/24/powershell-out-excelpivottable-quickly-create-pivot-tables-in-microsoft-excel/">PowerShell Out-ExcelPivotTable – Quickly Create Pivot Tables in Microsoft Excel</a></li>
</ul>
<li><a href="http://www.dougfinke.com/blog/index.php/category/powershell-pearls/">and more…</a></li>
</ul>
<p>Thanks to NYC Code Camp organizers, sponsors and volunteers who put in an amazing effort to make these events happen.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dougfinke.com/blog/index.php/2011/02/21/nyc-code-camp-powershell-talk/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>NimbleSet&#8211;Using PowerShell and WPK (WPF PowerShell Toolkit)</title>
		<link>http://www.dougfinke.com/blog/index.php/2010/12/20/nimblesetusing-powershell-and-wpk-wpf-powershell-toolkit/</link>
		<comments>http://www.dougfinke.com/blog/index.php/2010/12/20/nimblesetusing-powershell-and-wpk-wpf-powershell-toolkit/#comments</comments>
		<pubDate>Mon, 20 Dec 2010 16:29:21 +0000</pubDate>
		<dc:creator>Doug Finke</dc:creator>
				<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[PowerShell Modules]]></category>
		<category><![CDATA[PowerShell Pack]]></category>
		<category><![CDATA[PowerShell Pearls]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[WPK]]></category>

		<guid isPermaLink="false">http://www.dougfinke.com/blog/index.php/2010/12/20/nimblesetusing-powershell-and-wpk-wpf-powershell-toolkit/</guid>
		<description><![CDATA[secretGeek posted his web version of NimbleSet (helps you compare two lists). Try it HERE. I created his version in PowerShell using the WPK module from the PowerShell Pack. You’ll need to download and install the PowerShell Pack if you want to run the script. Check out the source below, download it and give it [...]]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.secretgeek.net/index.asp#top">secretGeek</a> posted his web version of NimbleSet (helps you compare two lists). Try it <a href="http://www.secretgeek.net/nimbleSet_intro.asp">HERE</a>.</p>
<p>I created his version in PowerShell using the WPK module from the PowerShell Pack. You’ll need to download and install the <a href="http://code.msdn.microsoft.com/PowerShellPack">PowerShell Pack</a> if you want to run the script.</p>
<p>Check out the source below, download it and give it a try.</p>
<table border="0" cellspacing="0" cellpadding="2" width="567">
<tbody>
<tr>
<td valign="top" width="306">
<p>If we want to see what items they have in common, click the &#8216;intersection&#8217; button.</p>
<blockquote><p>result (1 row)              <br />john</p>
</blockquote>
</td>
<td valign="top" width="259"><a href="http://dougfinke.com/uploadPictures/NimbleSet_95CB/image.png"><img style="background-image: none; border-right-width: 0px; margin: ; padding-left: 0px; padding-right: 0px; display: inline; float: right; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" align="right" src="http://dougfinke.com/uploadPictures/NimbleSet_95CB/image_thumb.png" width="240" height="240" /></a>           </td>
</tr>
<tr>
<td valign="top" width="306">
<p>To see which items are in the list on the left but not in the list on the right? Click &#8216;left only.&#8217;</p>
<blockquote><p>result (3 rows)              <br />paul               <br />george               <br />ringo</p>
</blockquote>
</td>
<td valign="top" width="259"><a href="http://dougfinke.com/uploadPictures/NimbleSet_95CB/image_3.png"><img style="background-image: none; border-right-width: 0px; margin: ; padding-left: 0px; padding-right: 0px; display: inline; float: right; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" align="right" src="http://dougfinke.com/uploadPictures/NimbleSet_95CB/image_thumb_3.png" width="240" height="240" /></a></td>
</tr>
<tr>
<td valign="top" width="306">
<p>To see the &#8216;right only&#8217; items click &#8216;right only.&#8217;</p>
<blockquote><p>result (3 rows)              <br />matthew               <br />mark               <br />luke</p>
</blockquote>
</td>
<td valign="top" width="259"><a href="http://dougfinke.com/uploadPictures/NimbleSet_95CB/image_4.png"><img style="background-image: none; border-right-width: 0px; margin: ; padding-left: 0px; padding-right: 0px; display: inline; float: right; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" align="right" src="http://dougfinke.com/uploadPictures/NimbleSet_95CB/image_thumb_4.png" width="240" height="240" /></a></td>
</tr>
<tr>
<td valign="top" width="306">
<p>To grab all the items press &#8216;union.&#8217; (You may notice that items from both lists will be repeated accordingly).</p>
<blockquote><p>result (8 rows)              <br />john               <br />paul               <br />george               <br />ringo               <br />matthew               <br />mark               <br />luke               <br />john</p>
</blockquote>
</td>
<td valign="top" width="259"><a href="http://dougfinke.com/uploadPictures/NimbleSet_95CB/image_5.png"><img style="background-image: none; border-right-width: 0px; margin: ; padding-left: 0px; padding-right: 0px; display: inline; float: right; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" align="right" src="http://dougfinke.com/uploadPictures/NimbleSet_95CB/image_thumb_5.png" width="240" height="240" /></a></td>
</tr>
<tr>
<td valign="top" width="306">
<p>To find the distinct members of the result set, press &#8216;distinct&#8217; (under the &#8216;result&#8217;)</p>
<blockquote><p>result (7 rows)              <br />john               <br />paul               <br />george               <br />ringo               <br />matthew               <br />mark               <br />luke</p>
</blockquote>
</td>
<td valign="top" width="259"><a href="http://dougfinke.com/uploadPictures/NimbleSet_95CB/image_6.png"><img style="background-image: none; border-right-width: 0px; margin: ; padding-left: 0px; padding-right: 0px; display: inline; float: right; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" align="right" src="http://dougfinke.com/uploadPictures/NimbleSet_95CB/image_thumb_6.png" width="240" height="240" /></a></td>
</tr>
<tr>
<td valign="top" width="306">
<p>To sort the results, as you often need to, press the sort button, under the result.</p>
<blockquote><p>result (7 rows)              <br />george               <br />john               <br />luke               <br />mark               <br />matthew               <br />paul               <br />ring</p>
</blockquote>
</td>
<td valign="top" width="259"><a href="http://dougfinke.com/uploadPictures/NimbleSet_95CB/image_7.png"><img style="background-image: none; border-right-width: 0px; margin: ; padding-left: 0px; padding-right: 0px; display: inline; float: right; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" align="right" src="http://dougfinke.com/uploadPictures/NimbleSet_95CB/image_thumb_7.png" width="240" height="240" /></a></td>
</tr>
</tbody>
</table>
<p>&#160;</p>
<h3>The Code</h3>
<p>The script uses some interesting aspects of PowerShell. Like the <em>function ql</em> which creates lists, well, quickly. Notice how the correct function is called&#160; (intersection, union etc) using the call operator ‘&amp;’ and the contents of the button that is clicked. Also checkout how <em><a href="http://blogs.technet.com/b/heyscriptingguy/archive/2010/10/18/use-splatting-to-simplify-your-powershell-scripts.aspx">splatting</a></em> simplifies the script when creating the buttons and textboxes.</p>
<pre style="width: 561px; height: 1466px" class="PowerShellColorizedScript"><span style="color: #0000ff">Import-Module</span> <span style="color: #8a2be2">WPK</span>            
            
<span style="color: #00008b">function</span> <span style="color: #8a2be2">ql</span> <span style="color: #000000">{</span><span style="color: #ff4500">$args</span><span style="color: #000000">}</span>            
            
<span style="color: #ff4500">$beatles</span> <span style="color: #a9a9a9">=</span> <span style="color: #000000">(</span><span style="color: #0000ff">ql</span> <span style="color: #8a2be2">john</span> <span style="color: #8a2be2">paul</span> <span style="color: #8a2be2">george</span> <span style="color: #8a2be2">ringo</span><span style="color: #000000">)</span> <span style="color: #a9a9a9">-join</span> <span style="color: #8b0000">&quot;`r`n&quot;</span>             
<span style="color: #ff4500">$gospels</span> <span style="color: #a9a9a9">=</span> <span style="color: #000000">(</span><span style="color: #0000ff">ql</span> <span style="color: #8a2be2">matthew</span> <span style="color: #8a2be2">mark</span> <span style="color: #8a2be2">luke</span> <span style="color: #8a2be2">john</span><span style="color: #000000">)</span> <span style="color: #a9a9a9">-join</span> <span style="color: #8b0000">&quot;`r`n&quot;</span>             
            
<span style="color: #00008b">function</span> <span style="color: #8a2be2">intersection</span> <span style="color: #000000">(</span><span style="color: #ff4500">$l</span><span style="color: #a9a9a9">,</span> <span style="color: #ff4500">$r</span><span style="color: #000000">)</span> <span style="color: #000000">{</span> <span style="color: #ff4500">$l</span> <span style="color: #a9a9a9">|</span> <span style="color: #0000ff">%</span> <span style="color: #000000">{</span> <span style="color: #ff4500">$r</span> <span style="color: #a9a9a9">-eq</span> <span style="color: #ff4500">$_</span> <span style="color: #000000">}</span> <span style="color: #000000">}</span>            
<span style="color: #00008b">function</span> <span style="color: #8a2be2">left-Only</span>    <span style="color: #000000">(</span><span style="color: #ff4500">$l</span><span style="color: #a9a9a9">,</span> <span style="color: #ff4500">$r</span><span style="color: #000000">)</span> <span style="color: #000000">{</span> <span style="color: #ff4500">$l</span> <span style="color: #a9a9a9">|</span> <span style="color: #0000ff">%</span> <span style="color: #000000">{</span> <span style="color: #00008b">if</span><span style="color: #000000">(</span><span style="color: #a9a9a9">!</span><span style="color: #000000">(</span><span style="color: #ff4500">$r</span> <span style="color: #a9a9a9">-eq</span> <span style="color: #ff4500">$_</span><span style="color: #000000">)</span><span style="color: #000000">)</span> <span style="color: #000000">{</span> <span style="color: #ff4500">$_</span> <span style="color: #000000">}</span> <span style="color: #000000">}</span> <span style="color: #000000">}</span>            
<span style="color: #00008b">function</span> <span style="color: #8a2be2">right-Only</span>   <span style="color: #000000">(</span><span style="color: #ff4500">$l</span><span style="color: #a9a9a9">,</span> <span style="color: #ff4500">$r</span><span style="color: #000000">)</span> <span style="color: #000000">{</span> <span style="color: #ff4500">$r</span> <span style="color: #a9a9a9">|</span> <span style="color: #0000ff">%</span> <span style="color: #000000">{</span> <span style="color: #00008b">if</span><span style="color: #000000">(</span><span style="color: #a9a9a9">!</span><span style="color: #000000">(</span><span style="color: #ff4500">$l</span> <span style="color: #a9a9a9">-eq</span> <span style="color: #ff4500">$_</span><span style="color: #000000">)</span><span style="color: #000000">)</span> <span style="color: #000000">{</span> <span style="color: #ff4500">$_</span> <span style="color: #000000">}</span> <span style="color: #000000">}</span> <span style="color: #000000">}</span>            
<span style="color: #00008b">function</span> <span style="color: #8a2be2">union</span>        <span style="color: #000000">(</span><span style="color: #ff4500">$l</span><span style="color: #a9a9a9">,</span> <span style="color: #ff4500">$r</span><span style="color: #000000">)</span> <span style="color: #000000">{</span> <span style="color: #ff4500">$l</span> <span style="color: #a9a9a9">+</span> <span style="color: #ff4500">$r</span> <span style="color: #000000">}</span>            
            
<span style="color: #00008b">function</span> <span style="color: #8a2be2">Compare-Lists</span> <span style="color: #000000">(</span><span style="color: #ff4500">$window</span><span style="color: #a9a9a9">,</span> <span style="color: #ff4500">$targetButton</span><span style="color: #000000">)</span> <span style="color: #000000">{</span>            
    <span style="color: #ff4500">$lhs</span> <span style="color: #a9a9a9">=</span> <span style="color: #000000">(</span><span style="color: #ff4500">$window</span> <span style="color: #a9a9a9">|</span> <span style="color: #0000ff">Get-ChildControl</span> <span style="color: #8a2be2">Left</span><span style="color: #000000">)</span><span style="color: #a9a9a9">.</span><span style="color: #000000">Text</span>            
    <span style="color: #ff4500">$rhs</span> <span style="color: #a9a9a9">=</span> <span style="color: #000000">(</span><span style="color: #ff4500">$window</span> <span style="color: #a9a9a9">|</span> <span style="color: #0000ff">Get-ChildControl</span> <span style="color: #8a2be2">Right</span><span style="color: #000000">)</span><span style="color: #a9a9a9">.</span><span style="color: #000000">Text</span>            
            
    <span style="color: #000000">(</span><span style="color: #ff4500">$window</span> <span style="color: #a9a9a9">|</span> <span style="color: #0000ff">Get-ChildControl</span> <span style="color: #8a2be2">Results</span><span style="color: #000000">)</span><span style="color: #a9a9a9">.</span><span style="color: #000000">Text</span> <span style="color: #a9a9a9">=</span> <span style="color: #000000">@(</span>            
        <span style="color: #a9a9a9">&amp;</span> <span style="color: #ff4500">$targetButton</span><span style="color: #a9a9a9">.</span><span style="color: #000000">Content</span> <span style="color: #000000">(</span><span style="color: #ff4500">$lhs</span> <span style="color: #a9a9a9">-split</span> <span style="color: #8b0000">&quot;`r`n&quot;</span><span style="color: #000000">)</span> <span style="color: #000000">(</span><span style="color: #ff4500">$rhs</span> <span style="color: #a9a9a9">-split</span> <span style="color: #8b0000">&quot;`r`n&quot;</span><span style="color: #000000">)</span>            
    <span style="color: #000000">)</span> <span style="color: #a9a9a9">-join</span> <span style="color: #8b0000">&quot;`r`n&quot;</span>            
<span style="color: #000000">}</span>            
            
<span style="color: #00008b">function</span> <span style="color: #8a2be2">PostProcess-List</span> <span style="color: #000000">(</span><span style="color: #ff4500">$window</span><span style="color: #a9a9a9">,</span> <span style="color: #ff4500">$targetButton</span><span style="color: #000000">)</span> <span style="color: #000000">{</span>            
    <span style="color: #ff4500">$txtBox</span>  <span style="color: #a9a9a9">=</span> <span style="color: #ff4500">$window</span> <span style="color: #a9a9a9">|</span> <span style="color: #0000ff">Get-ChildControl</span> <span style="color: #8a2be2">Results</span>             
    <span style="color: #ff4500">$left</span>    <span style="color: #a9a9a9">=</span> <span style="color: #ff4500">$window</span> <span style="color: #a9a9a9">|</span> <span style="color: #0000ff">Get-ChildControl</span> <span style="color: #8a2be2">Left</span>            
    <span style="color: #ff4500">$right</span>   <span style="color: #a9a9a9">=</span> <span style="color: #ff4500">$window</span> <span style="color: #a9a9a9">|</span> <span style="color: #0000ff">Get-ChildControl</span> <span style="color: #8a2be2">Right</span>            
                
    <span style="color: #ff4500">$results</span> <span style="color: #a9a9a9">=</span> <span style="color: #000000">@(</span><span style="color: #ff4500">$txtBox</span><span style="color: #a9a9a9">.</span><span style="color: #000000">Text</span> <span style="color: #a9a9a9">-split</span> <span style="color: #8b0000">&quot;`r`n&quot;</span><span style="color: #000000">)</span>            
                
    <span style="color: #00008b">switch</span> <span style="color: #000000">(</span> <span style="color: #ff4500">$targetButton</span><span style="color: #a9a9a9">.</span><span style="color: #000000">Content</span> <span style="color: #000000">)</span> <span style="color: #000000">{</span>            
        <span style="color: #8b0000">&quot;distinct&quot;</span>   <span style="color: #000000">{</span> <span style="color: #ff4500">$results</span> <span style="color: #a9a9a9">=</span> <span style="color: #ff4500">$results</span> <span style="color: #a9a9a9">|</span> <span style="color: #0000ff">select</span> <span style="color: #000080">-Unique</span> <span style="color: #000000">}</span>            
        <span style="color: #8b0000">&quot;sort&quot;</span>       <span style="color: #000000">{</span> <span style="color: #ff4500">$results</span> <span style="color: #a9a9a9">=</span> <span style="color: #ff4500">$results</span> <span style="color: #a9a9a9">|</span> <span style="color: #0000ff">sort</span> <span style="color: #000000">}</span>            
        <span style="color: #8b0000">&quot;invert&quot;</span>     <span style="color: #000000">{</span> <span style="color: #008080">[array]</span><span style="color: #a9a9a9">::</span><span style="color: #000000">Reverse</span><span style="color: #000000">(</span><span style="color: #ff4500">$results</span><span style="color: #000000">)</span> <span style="color: #000000">}</span>            
        <span style="color: #8b0000">&quot;copy left&quot;</span>  <span style="color: #000000">{</span> <span style="color: #ff4500">$left</span><span style="color: #a9a9a9">.</span><span style="color: #000000">Text</span> <span style="color: #a9a9a9">=</span> <span style="color: #ff4500">$txtBox</span><span style="color: #a9a9a9">.</span><span style="color: #000000">Text</span><span style="color: #000000">;</span>  <span style="color: #00008b">return</span> <span style="color: #000000">}</span>            
        <span style="color: #8b0000">&quot;copy right&quot;</span> <span style="color: #000000">{</span> <span style="color: #ff4500">$right</span><span style="color: #a9a9a9">.</span><span style="color: #000000">Text</span> <span style="color: #a9a9a9">=</span> <span style="color: #ff4500">$txtBox</span><span style="color: #a9a9a9">.</span><span style="color: #000000">Text</span><span style="color: #000000">;</span> <span style="color: #00008b">return</span> <span style="color: #000000">}</span>            
    <span style="color: #000000">}</span>            
                
    <span style="color: #ff4500">$txtBox</span><span style="color: #a9a9a9">.</span><span style="color: #000000">Text</span> <span style="color: #a9a9a9">=</span> <span style="color: #000000">(</span><span style="color: #ff4500">$results</span><span style="color: #000000">)</span> <span style="color: #a9a9a9">-join</span> <span style="color: #8b0000">&quot;`r`n&quot;</span>             
<span style="color: #000000">}</span>            
            
<span style="color: #0000ff">New-Window</span> <span style="color: #000080">-WindowStartupLocation</span> <span style="color: #8a2be2">CenterScreen</span> <span style="color: #000080">-Width</span> <span style="color: #800080">500</span> <span style="color: #000080">-Height</span> <span style="color: #800080">500</span> <span style="color: #000080">-show</span> <span style="color: #000000">{</span>            
    <span style="color: #0000ff">New-Grid</span> <span style="color: #000080">-Rows</span> <span style="color: #8a2be2">Auto</span><span style="color: #a9a9a9">,</span> <span style="color: #8a2be2">300*</span> <span style="color: #000000">{</span>            
        <span style="color: #ff4500">$buttonStyle</span> <span style="color: #a9a9a9">=</span> <span style="color: #000000">@{</span>            
            <span style="color: #000000">Margin</span> <span style="color: #a9a9a9">=</span> <span style="color: #800080">4</span>             
            <span style="color: #000000">Height</span> <span style="color: #a9a9a9">=</span> <span style="color: #800080">32</span>             
            <span style="color: #000000">VerticalAlignment</span> <span style="color: #a9a9a9">=</span> <span style="color: #8b0000">&quot;top&quot;</span>            
        <span style="color: #000000">}</span>            
                    
        <span style="color: #ff4500">$textBoxStyle</span> <span style="color: #a9a9a9">=</span> <span style="color: #000000">@{</span>            
            <span style="color: #000000">Row</span> <span style="color: #a9a9a9">=</span> <span style="color: #800080">0</span>             
            <span style="color: #000000">Margin</span> <span style="color: #a9a9a9">=</span> <span style="color: #800080">4</span>             
            <span style="color: #000000">AcceptsReturn</span> <span style="color: #a9a9a9">=</span> <span style="color: #ff4500">$true</span>            
            <span style="color: #000000">VerticalScrollBarVisibility</span> <span style="color: #a9a9a9">=</span> <span style="color: #8b0000">&quot;Auto&quot;</span>            
        <span style="color: #000000">}</span>            
                    
        <span style="color: #0000ff">New-Grid</span> <span style="color: #000080">-Row</span> <span style="color: #800080">0</span> <span style="color: #000080">-Columns</span> <span style="color: #800080">2</span> <span style="color: #000080">-Rows</span> <span style="color: #800080">2</span> <span style="color: #000080">-VerticalAlignment</span> <span style="color: #8a2be2">top</span> <span style="color: #000000">{</span>            
                        
            <span style="color: #0000ff">New-TextBox</span> <span style="color: #000080">-Name</span> <span style="color: #8a2be2">Left</span>  <span style="color: #000080">-Text</span> <span style="color: #ff4500">$beatles</span> <span style="color: #000080">-Column</span> <span style="color: #800080">0</span> <span style="color: #ff4500">@textBoxStyle</span>            
            <span style="color: #0000ff">New-TextBox</span> <span style="color: #000080">-Name</span> <span style="color: #8a2be2">Right</span> <span style="color: #000080">-Text</span> <span style="color: #ff4500">$gospels</span> <span style="color: #000080">-Column</span> <span style="color: #800080">1</span> <span style="color: #ff4500">@textBoxStyle</span>            
                        
            <span style="color: #0000ff">New-StackPanel</span> <span style="color: #000080">-Row</span> <span style="color: #800080">1</span> <span style="color: #000080">-Column</span> <span style="color: #800080">0</span> <span style="color: #000080">-ColumnSpan</span> <span style="color: #800080">2</span> <span style="color: #000080">-Orientation</span> <span style="color: #8a2be2">Horizontal</span> <span style="color: #000000">{</span>            
                <span style="color: #0000ff">New-Button</span> <span style="color: #8b0000">&quot;union&quot;</span>        <span style="color: #ff4500">@buttonStyle</span> <span style="color: #000080">-On_Click</span> <span style="color: #000000">{</span> <span style="color: #0000ff">Compare-Lists</span> <span style="color: #ff4500">$window</span> <span style="color: #ff4500">$this</span> <span style="color: #000000">}</span>            
                <span style="color: #0000ff">New-Button</span> <span style="color: #8b0000">&quot;left-only&quot;</span>    <span style="color: #ff4500">@buttonStyle</span> <span style="color: #000080">-On_Click</span> <span style="color: #000000">{</span> <span style="color: #0000ff">Compare-Lists</span> <span style="color: #ff4500">$window</span> <span style="color: #ff4500">$this</span> <span style="color: #000000">}</span>            
                <span style="color: #0000ff">New-Button</span> <span style="color: #8b0000">&quot;intersection&quot;</span> <span style="color: #ff4500">@buttonStyle</span> <span style="color: #000080">-On_Click</span> <span style="color: #000000">{</span> <span style="color: #0000ff">Compare-Lists</span> <span style="color: #ff4500">$window</span> <span style="color: #ff4500">$this</span> <span style="color: #000000">}</span>            
                <span style="color: #0000ff">New-Button</span> <span style="color: #8b0000">&quot;right-only&quot;</span>   <span style="color: #ff4500">@buttonStyle</span> <span style="color: #000080">-On_Click</span> <span style="color: #000000">{</span> <span style="color: #0000ff">Compare-Lists</span> <span style="color: #ff4500">$window</span> <span style="color: #ff4500">$this</span> <span style="color: #000000">}</span>            
            <span style="color: #000000">}</span>            
        <span style="color: #000000">}</span>            
                    
        <span style="color: #0000ff">New-Grid</span> <span style="color: #000080">-Row</span> <span style="color: #800080">1</span> <span style="color: #000080">-Rows</span> <span style="color: #8a2be2">1*</span><span style="color: #a9a9a9">,</span> <span style="color: #800080">40</span> <span style="color: #000080">-Margin</span> <span style="color: #800080">4</span> <span style="color: #000000">{</span>            
            <span style="color: #0000ff">New-TextBox</span> <span style="color: #000080">-Name</span> <span style="color: #8a2be2">Results</span> <span style="color: #000080">-Row</span> <span style="color: #800080">0</span> <span style="color: #000080">-Margin</span> <span style="color: #800080">4</span> <span style="color: #000080">-MinHeight</span> <span style="color: #800080">275</span>            
            
            <span style="color: #0000ff">New-StackPanel</span> <span style="color: #000080">-Row</span> <span style="color: #800080">1</span> <span style="color: #000080">-Column</span> <span style="color: #800080">0</span> <span style="color: #000080">-ColumnSpan</span> <span style="color: #800080">2</span> <span style="color: #000080">-Orientation</span> <span style="color: #8a2be2">Horizontal</span> <span style="color: #000000">{</span>            
                <span style="color: #0000ff">New-Button</span> <span style="color: #8b0000">&quot;distinct&quot;</span>   <span style="color: #ff4500">@buttonStyle</span> <span style="color: #000080">-On_Click</span> <span style="color: #000000">{</span> <span style="color: #0000ff">PostProcess-List</span> <span style="color: #ff4500">$window</span> <span style="color: #ff4500">$this</span> <span style="color: #000000">}</span>            
                <span style="color: #0000ff">New-Button</span> <span style="color: #8b0000">&quot;sort&quot;</span>       <span style="color: #ff4500">@buttonStyle</span> <span style="color: #000080">-On_Click</span> <span style="color: #000000">{</span> <span style="color: #0000ff">PostProcess-List</span> <span style="color: #ff4500">$window</span> <span style="color: #ff4500">$this</span> <span style="color: #000000">}</span>            
                <span style="color: #0000ff">New-Button</span> <span style="color: #8b0000">&quot;invert&quot;</span>     <span style="color: #ff4500">@buttonStyle</span> <span style="color: #000080">-On_Click</span> <span style="color: #000000">{</span> <span style="color: #0000ff">PostProcess-List</span> <span style="color: #ff4500">$window</span> <span style="color: #ff4500">$this</span> <span style="color: #000000">}</span>            
                <span style="color: #0000ff">New-Button</span> <span style="color: #8b0000">&quot;copy left&quot;</span>  <span style="color: #ff4500">@buttonStyle</span> <span style="color: #000080">-On_Click</span> <span style="color: #000000">{</span> <span style="color: #0000ff">PostProcess-List</span> <span style="color: #ff4500">$window</span> <span style="color: #ff4500">$this</span> <span style="color: #000000">}</span>            
                <span style="color: #0000ff">New-Button</span> <span style="color: #8b0000">&quot;copy right&quot;</span> <span style="color: #ff4500">@buttonStyle</span> <span style="color: #000080">-On_Click</span> <span style="color: #000000">{</span> <span style="color: #0000ff">PostProcess-List</span> <span style="color: #ff4500">$window</span> <span style="color: #ff4500">$this</span> <span style="color: #000000">}</span>            
            <span style="color: #000000">}</span>            
        <span style="color: #000000">}</span>                    
    <span style="color: #000000">}</span>            
<span style="color: #000000">}</span></pre>
<h3>Download It</h3>
<p><iframe style="padding-bottom: 0px; background-color: #fcfcfc; padding-left: 0px; width: 98px; padding-right: 0px; height: 115px; padding-top: 0px" title="Preview" marginheight="0" src="http://cid-5dec3b62d9308943.office.live.com/embedicon.aspx/NimbleSet" frameborder="0" marginwidth="0" scrolling="no"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dougfinke.com/blog/index.php/2010/12/20/nimblesetusing-powershell-and-wpk-wpf-powershell-toolkit/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
