<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US"><title type="html">Media And Microcode</title><subtitle type="html">Microcode. Movies. Music. Games.  Personal Musings. - James Brundage's Personal Blog</subtitle><id>http://blogs.msdn.com/b/mediaandmicrocode/atom.aspx</id><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/mediaandmicrocode/" /><link rel="self" type="application/atom+xml" href="http://blogs.msdn.com/b/mediaandmicrocode/atom.aspx" /><generator uri="http://telligent.com" version="5.6.50428.7875">Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><updated>2008-12-28T00:45:35Z</updated><entry><title>Get-ComputersNearMe</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/mediaandmicrocode/archive/2010/01/06/get-computersnearme.aspx" /><id>http://blogs.msdn.com/b/mediaandmicrocode/archive/2010/01/06/get-computersnearme.aspx</id><published>2010-01-06T02:16:37Z</published><updated>2010-01-06T02:16:37Z</updated><content type="html">&lt;p&gt;Today I learned a little bit about how to get to some of the data stored within special shell folders.&amp;#160; You can get a list of all of the easy-to-get-to special folders &lt;a href="http://msdn.microsoft.com/en-us/library/bb774096(VS.85).aspx"&gt;here&lt;/a&gt;.&amp;#160; I noticed one folder in particular that a bunch of systems administrators I know want to read, and that’s the Nearby Computers page.&amp;#160; Here’s a quick 23-line function that will go and get all of the computers from the Nearby Computers page, ping them, and return the Win32_PingStatus objects.&lt;/p&gt;  &lt;pre class="PowerShellColorizedScript"&gt;&lt;span style="color: #00008b"&gt;function&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;Get-ComputersNearMe&lt;/span&gt;            
&lt;span style="color: #000000"&gt;{&lt;/span&gt;            
    &lt;span style="color: #006400"&gt;&amp;lt;#
    .Synopsis
        Returns the Computers Near Me
    .Description
        Returns all of the computers listed in the &amp;quot;Computers Near Me&amp;quot; or &amp;quot;Access the computers and devices tht are on your network&amp;quot; shell
        namespace.  Uses the Shell.Application API to get the computers folder, and then uses Test-Connection to return the machines and their
        response times.
    .Example
        Get-ComputersNearMe
    #&amp;gt;&lt;/span&gt;            
    &lt;span style="color: #00008b"&gt;param&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;/span&gt;            
    &lt;span style="color: #ff4500"&gt;$computersFolder&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #800080"&gt;0x12&lt;/span&gt;            
    &lt;span style="color: #ff4500"&gt;$shell&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #0000ff"&gt;New-Object&lt;/span&gt; &lt;span style="color: #000080"&gt;-ComObject&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;Shell.Application&lt;/span&gt;            
    &lt;span style="color: #ff4500"&gt;$shell&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;NameSpace&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #ff4500"&gt;$computersFolder&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;Items&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;|&lt;/span&gt;            
        &lt;span style="color: #0000ff"&gt;Where-Object&lt;/span&gt; &lt;span style="color: #000000"&gt;{&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$_&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;Path&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;-like&lt;/span&gt; &lt;span style="color: #8b0000"&gt;&amp;quot;\\*&amp;quot;&lt;/span&gt; &lt;span style="color: #000000"&gt;}&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;|&lt;/span&gt;            
        &lt;span style="color: #0000ff"&gt;ForEach-Object&lt;/span&gt; &lt;span style="color: #000000"&gt;{&lt;/span&gt;             
            &lt;span style="color: #0000ff"&gt;Test-Connection&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$_&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;Name&lt;/span&gt; &lt;span style="color: #000080"&gt;-AsJob&lt;/span&gt;            
        &lt;span style="color: #000000"&gt;}&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;|&lt;/span&gt;             
        &lt;span style="color: #0000ff"&gt;Wait-Job&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;|&lt;/span&gt;            
        &lt;span style="color: #0000ff"&gt;Receive-Job&lt;/span&gt;             
&lt;span style="color: #000000"&gt;}&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;As you can see, the whole first half of the script is the help.&amp;#160; $computersFolder is set to one of the magic constants listed on the MSDN page, and then I simply use the COM Object Shell.Application (which should be familiar to anyone that’s done a decent amount of VBScript) to get the folder.&amp;#160; Two types of items will be returned from this:&amp;#160; UNC paths to a machine and links to specific devices (like a media player library).&amp;#160; I filter out only the UNC paths with Where-Object, and then I do Test-Connection –AsJob to try to ping the machines.&amp;#160; The last bit of the script waits for all of the pings to come back, and returns the results to the user.&amp;#160; Since Win32_PingStatus already has a formatter that displays the source, destination, IPV4 address, IPV6 address, and time to ping, so there’s really nothing else I want to add.&lt;/p&gt;

&lt;p&gt;Get-ComputersNearMe should be easy enough to use in small businesses, workgroups, or wherever else you find yourself using that screen.&lt;/p&gt;

&lt;p&gt;Hope this helps,&lt;/p&gt;

&lt;p&gt;James&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9944329" width="1" height="1"&gt;</content><author><name>JamesBrundage</name><uri>http://blogs.msdn.com/JamesBrundage/ProfileUrlRedirect.ashx</uri></author><category term="PowerShell" scheme="http://blogs.msdn.com/b/mediaandmicrocode/archive/tags/PowerShell/" /></entry><entry><title>Write-Progress &amp;amp; WPK</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/mediaandmicrocode/archive/2009/12/28/write-progress-wpk.aspx" /><id>http://blogs.msdn.com/b/mediaandmicrocode/archive/2009/12/28/write-progress-wpk.aspx</id><published>2009-12-28T21:10:43Z</published><updated>2009-12-28T21:10:43Z</updated><content type="html">&lt;p&gt;A nifty trick that you can do in WPK is create a WPF progress bar to show the Write-Progress output from a PowerShell script.&amp;#160; I was reminded that people actually wanted to do this when I ran across a question on StackOverflow, and posted &lt;a href="http://stackoverflow.com/questions/1959129/insert-progressbar-into-statusbar-panel-using-powershell-and-windows-forms/1971546#1971546"&gt;this answer&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;In case you don’t want to follow the link, here’s a quick script to show progress from a background runspace in WPK.&amp;#160; The top half set ups a bunch of data bindings that will bind to whatever DataContext is found, and the second half of the script is a small sample of Write-Progress output.&lt;/p&gt;  &lt;pre class="PowerShellColorizedScript"&gt;&lt;span style="color: #0000ff"&gt;New-Grid&lt;/span&gt; &lt;span style="color: #000080"&gt;-Columns&lt;/span&gt; &lt;span style="color: #800080"&gt;2&lt;/span&gt; &lt;span style="color: #000000"&gt;{&lt;/span&gt;            
    &lt;span style="color: #0000ff"&gt;New-TextBlock&lt;/span&gt; &lt;span style="color: #000080"&gt;-Margin&lt;/span&gt; &lt;span style="color: #800080"&gt;10&lt;/span&gt; &lt;span style="color: #000080"&gt;-TextWrapping&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;Wrap&lt;/span&gt; &lt;span style="color: #000080"&gt;-ZIndex&lt;/span&gt; &lt;span style="color: #800080"&gt;1&lt;/span&gt; &lt;span style="color: #000080"&gt;-HorizontalAlignment&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;Left&lt;/span&gt; &lt;span style="color: #000080"&gt;-FontWeight&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;Bold&lt;/span&gt; &lt;span style="color: #000080"&gt;-FontSize&lt;/span&gt; &lt;span style="color: #800080"&gt;12&lt;/span&gt; &lt;span style="color: #000080"&gt;-DataBinding&lt;/span&gt; &lt;span style="color: #000000"&gt;@{&lt;/span&gt;            
        &lt;span style="color: #8b0000"&gt;&amp;quot;Text&amp;quot;&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #8b0000"&gt;&amp;quot;LastProgress.Activity&amp;quot;&lt;/span&gt;            
    &lt;span style="color: #000000"&gt;}&lt;/span&gt;            
    &lt;span style="color: #0000ff"&gt;New-TextBlock&lt;/span&gt; &lt;span style="color: #000080"&gt;-Margin&lt;/span&gt; &lt;span style="color: #800080"&gt;10&lt;/span&gt; &lt;span style="color: #000080"&gt;-ZIndex&lt;/span&gt; &lt;span style="color: #800080"&gt;1&lt;/span&gt; &lt;span style="color: #000080"&gt;-TextWrapping&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;Wrap&lt;/span&gt; &lt;span style="color: #000080"&gt;-Column&lt;/span&gt; &lt;span style="color: #800080"&gt;1&lt;/span&gt; &lt;span style="color: #000080"&gt;-VerticalAlignment&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;Bottom&lt;/span&gt; &lt;span style="color: #000080"&gt;-HorizontalAlignment&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;Right&lt;/span&gt; &lt;span style="color: #000080"&gt;-FontStyle&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;Italic&lt;/span&gt; &lt;span style="color: #000080"&gt;-FontSize&lt;/span&gt; &lt;span style="color: #800080"&gt;12&lt;/span&gt; &lt;span style="color: #000080"&gt;-DataBinding&lt;/span&gt; &lt;span style="color: #000000"&gt;@{&lt;/span&gt;            
        &lt;span style="color: #8b0000"&gt;&amp;quot;Text&amp;quot;&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #8b0000"&gt;&amp;quot;LastProgress.StatusDescription&amp;quot;&lt;/span&gt;            
    &lt;span style="color: #000000"&gt;}&lt;/span&gt;            
    &lt;span style="color: #0000ff"&gt;New-ProgressBar&lt;/span&gt; &lt;span style="color: #000080"&gt;-ColumnSpan&lt;/span&gt; &lt;span style="color: #800080"&gt;2&lt;/span&gt; &lt;span style="color: #000080"&gt;-MinHeight&lt;/span&gt; &lt;span style="color: #800080"&gt;250&lt;/span&gt; &lt;span style="color: #000080"&gt;-Name&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;ProgressPercent&lt;/span&gt; &lt;span style="color: #000080"&gt;-DataBinding&lt;/span&gt; &lt;span style="color: #000000"&gt;@{&lt;/span&gt;            
        &lt;span style="color: #8b0000"&gt;&amp;quot;Value&amp;quot;&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #8b0000"&gt;&amp;quot;LastProgress.PercentComplete&amp;quot;&lt;/span&gt;            
    &lt;span style="color: #000000"&gt;}&lt;/span&gt;            
&lt;span style="color: #000000"&gt;}&lt;/span&gt; &lt;span style="color: #000080"&gt;-DataContext&lt;/span&gt; &lt;span style="color: #000000"&gt;{&lt;/span&gt;            
    &lt;span style="color: #0000ff"&gt;Get-PowerShellDataSource&lt;/span&gt; &lt;span style="color: #000080"&gt;-Script&lt;/span&gt; &lt;span style="color: #000000"&gt;{&lt;/span&gt;             
        &lt;span style="color: #00008b"&gt;foreach&lt;/span&gt; &lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #ff4500"&gt;$n&lt;/span&gt; &lt;span style="color: #00008b"&gt;in&lt;/span&gt; &lt;span style="color: #800080"&gt;1&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;..&lt;/span&gt;&lt;span style="color: #800080"&gt;100&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;/span&gt; &lt;span style="color: #000000"&gt;{&lt;/span&gt;            
            &lt;span style="color: #0000ff"&gt;Write-Progress&lt;/span&gt; &lt;span style="color: #8b0000"&gt;&amp;quot;MajorProgress&amp;quot;&lt;/span&gt; &lt;span style="color: #8b0000"&gt;&amp;quot;MinorProgress&amp;quot;&lt;/span&gt; &lt;span style="color: #000080"&gt;-PercentComplete&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$n&lt;/span&gt;            
            &lt;span style="color: #0000ff"&gt;Start-Sleep&lt;/span&gt; &lt;span style="color: #000080"&gt;-Milliseconds&lt;/span&gt; &lt;span style="color: #800080"&gt;250&lt;/span&gt;            
        &lt;span style="color: #000000"&gt;}&lt;/span&gt;            
    &lt;span style="color: #000000"&gt;}&lt;/span&gt;            
&lt;span style="color: #000000"&gt;}&lt;/span&gt; &lt;span style="color: #000080"&gt;-AsJob&lt;/span&gt;            &lt;/pre&gt;

&lt;p&gt;Hope this Helps&lt;/p&gt;

&lt;p&gt;James Brundage [MSFT]&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9941716" width="1" height="1"&gt;</content><author><name>JamesBrundage</name><uri>http://blogs.msdn.com/JamesBrundage/ProfileUrlRedirect.ashx</uri></author><category term="WPF" scheme="http://blogs.msdn.com/b/mediaandmicrocode/archive/tags/WPF/" /><category term="PowerShellPack" scheme="http://blogs.msdn.com/b/mediaandmicrocode/archive/tags/PowerShellPack/" /><category term="WPK" scheme="http://blogs.msdn.com/b/mediaandmicrocode/archive/tags/WPK/" /><category term="DataBinding" scheme="http://blogs.msdn.com/b/mediaandmicrocode/archive/tags/DataBinding/" /></entry><entry><title>Test-Spelling</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/mediaandmicrocode/archive/2009/12/09/test-spelling.aspx" /><id>http://blogs.msdn.com/b/mediaandmicrocode/archive/2009/12/09/test-spelling.aspx</id><published>2009-12-09T08:54:41Z</published><updated>2009-12-09T08:54:41Z</updated><content type="html">&lt;p&gt;The Integrated Scripting Environment has many things: A rich debugger, a nifty object model,&amp;#160; and support for multiple runspaces, but it doesn’t have spell check.&amp;#160; Since I end up writing a lot of documentation in the ISE for my functions, I decided to write a quick Spellchecker function.&lt;/p&gt;  &lt;p&gt;In order to write this I used some functions from IsePack and some functions from WPK.&amp;#160; Both IsePack and WPK can be found as part of the &lt;a href="http://code.msdn.microsoft.com/PowerShellPack"&gt;PowerShellPack&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;WPF text controls actually all have a spell check built into them, which saves almost all of the trouble of getting this to work.&amp;#160; Unfortunately, it means that the spell check as it is written pops up a small UI for each thing you want to check.&lt;/p&gt;  &lt;pre class="PowerShellColorizedScript"&gt;&lt;span style="color: #0000ff"&gt;Import-Module&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;IsePack&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;,&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;WPK&lt;/span&gt;            
            
&lt;span style="color: #00008b"&gt;function&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;Test-Spelling&lt;/span&gt; &lt;span style="color: #000000"&gt;{&lt;/span&gt;            
    &lt;span style="color: #006400"&gt;&amp;lt;#
    .Synopsis
        Tests the spelling on some text
    .Description
        Launches a text box with spell check enabled to highlight any spelling errors.
    .Example
        Test-Spelling &amp;quot;Can I speel?&amp;quot;
    .Example
        # Uses IsePack's Add-IseMenu to add a spellcheck hotkey to the Ise
        Add-IseMenu -Name &amp;quot;SpellCheck&amp;quot; -Menu @{
            &amp;quot;Test-Spelling&amp;quot; = {
                Select-CurrentText -NotInOutput | 
                    Where-Object { $_ } | 
                    Test-Spelling
            } | Add-Member NoteProperty ShortcutKey F7 -PassThru
        }
    #&amp;gt;&lt;/span&gt;            
    &lt;span style="color: #00008b"&gt;param&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;            
    &lt;span style="color: #006400"&gt;# The phrase to check for spelling errors&lt;/span&gt;            
    &lt;span style="color: #a9a9a9"&gt;[&lt;/span&gt;&lt;span style="color: #a0522d"&gt;Parameter&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #000000"&gt;ValueFromPipeline&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt;&lt;span style="color: #ff4500"&gt;$true&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;]&lt;/span&gt;            
    &lt;span style="color: #ff4500"&gt;$phrase&lt;/span&gt;            
    &lt;span style="color: #000000"&gt;)&lt;/span&gt;            
                
    &lt;span style="color: #00008b"&gt;process&lt;/span&gt; &lt;span style="color: #000000"&gt;{&lt;/span&gt;            
        &lt;span style="color: #0000ff"&gt;New-TextBox&lt;/span&gt; &lt;span style="color: #000080"&gt;-Resource&lt;/span&gt; &lt;span style="color: #000000"&gt;@{&lt;/span&gt;&lt;span style="color: #000000"&gt;Phrase&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt;&lt;span style="color: #ff4500"&gt;$phrase&lt;/span&gt;&lt;span style="color: #000000"&gt;}&lt;/span&gt; &lt;span style="color: #000080"&gt;-On_Loaded&lt;/span&gt; &lt;span style="color: #000000"&gt;{&lt;/span&gt;            
            &lt;span style="color: #ff4500"&gt;$phrase&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$this&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;Resources&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;Phrase&lt;/span&gt;            
            &lt;span style="color: #ff4500"&gt;$this&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;Text&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$phrase&lt;/span&gt;            
            &lt;span style="color: #ff4500"&gt;$this&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;SpellCheck&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;IsEnabled&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$true&lt;/span&gt;            
        &lt;span style="color: #000000"&gt;}&lt;/span&gt; &lt;span style="color: #000080"&gt;-ASJob&lt;/span&gt;            
    &lt;span style="color: #000000"&gt;}&lt;/span&gt;            
&lt;span style="color: #000000"&gt;}&lt;/span&gt;            
            
&lt;span style="color: #0000ff"&gt;Add-IseMenu&lt;/span&gt; &lt;span style="color: #000080"&gt;-Name&lt;/span&gt; &lt;span style="color: #8b0000"&gt;&amp;quot;SpellCheck&amp;quot;&lt;/span&gt; &lt;span style="color: #000080"&gt;-Menu&lt;/span&gt; &lt;span style="color: #000000"&gt;@{&lt;/span&gt;            
    &lt;span style="color: #8b0000"&gt;&amp;quot;Test-Spelling&amp;quot;&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #000000"&gt;{&lt;/span&gt;            
        &lt;span style="color: #0000ff"&gt;Select-CurrentText&lt;/span&gt; &lt;span style="color: #000080"&gt;-NotInOutput&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;|&lt;/span&gt;             
            &lt;span style="color: #0000ff"&gt;Where-Object&lt;/span&gt; &lt;span style="color: #000000"&gt;{&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$_&lt;/span&gt; &lt;span style="color: #000000"&gt;}&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;|&lt;/span&gt;             
            &lt;span style="color: #0000ff"&gt;Test-Spelling&lt;/span&gt;            
    &lt;span style="color: #000000"&gt;}&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;|&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Add-Member&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;NoteProperty&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;ShortcutKey&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;F7&lt;/span&gt; &lt;span style="color: #000080"&gt;-PassThru&lt;/span&gt;            
&lt;span style="color: #000000"&gt;}&lt;/span&gt;            
            &lt;/pre&gt;

&lt;p&gt;The script imports IsePack and WPK, writes the test spelling function Test-Spelling (with an example from the command line and an example that adds the menu item), and adds it to the IseMenu all in a scant 42 lines. Go ahead and give it a try. F7 becomes the shortcut key for spell check, just as it is in Word. &lt;/p&gt;

&lt;p&gt;Hope this helps, &lt;/p&gt;

&lt;p&gt;James Brundage [MSFT]&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9934474" width="1" height="1"&gt;</content><author><name>JamesBrundage</name><uri>http://blogs.msdn.com/JamesBrundage/ProfileUrlRedirect.ashx</uri></author><category term="WPK" scheme="http://blogs.msdn.com/b/mediaandmicrocode/archive/tags/WPK/" /><category term="IsePack" scheme="http://blogs.msdn.com/b/mediaandmicrocode/archive/tags/IsePack/" /></entry><entry><title>New WPK Video Online: Multitouch Fingerpaint in 30 Lines of PowerShell Script</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/mediaandmicrocode/archive/2009/10/30/new-wpk-video-online-multitouch-fingerpaint-in-30-lines-of-powershell-script.aspx" /><id>http://blogs.msdn.com/b/mediaandmicrocode/archive/2009/10/30/new-wpk-video-online-multitouch-fingerpaint-in-30-lines-of-powershell-script.aspx</id><published>2009-10-30T20:32:21Z</published><updated>2009-10-30T20:32:21Z</updated><content type="html">&lt;p&gt;The 2nd video about WPK just hit Channel9.&amp;#160; The first video was a video walk thru of &lt;a href="http://channel9.msdn.com/posts/LarryLarsen/Quick-UI-with-WPK-in-Windows-PowerShell"&gt;How to Write User Interfaces with WPK&lt;/a&gt;, and this video walks thru &lt;a href="http://channel9.msdn.com/posts/LarryLarsen/Multitouch-Fingerpaint-in-30-Lines-of-PowerShell-Script/"&gt;How to Write a Multitouch FingerPaint with WPK&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Enjoy,&lt;/p&gt;  &lt;p&gt;James Brundage [MSFT] &lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9915455" width="1" height="1"&gt;</content><author><name>JamesBrundage</name><uri>http://blogs.msdn.com/JamesBrundage/ProfileUrlRedirect.ashx</uri></author><category term="MultiTouch" scheme="http://blogs.msdn.com/b/mediaandmicrocode/archive/tags/MultiTouch/" /><category term="PowerShellPack" scheme="http://blogs.msdn.com/b/mediaandmicrocode/archive/tags/PowerShellPack/" /><category term="WPK" scheme="http://blogs.msdn.com/b/mediaandmicrocode/archive/tags/WPK/" /></entry><entry><title>Microcode: PowerShell Scripting Trick: Fun With Parameter Binding: The Fake Parameter Set Trick</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/mediaandmicrocode/archive/2009/04/10/microcode-powershell-scripting-trick-fun-with-parameter-binding-the-fake-parameter-set-trick.aspx" /><id>http://blogs.msdn.com/b/mediaandmicrocode/archive/2009/04/10/microcode-powershell-scripting-trick-fun-with-parameter-binding-the-fake-parameter-set-trick.aspx</id><published>2009-04-10T10:00:04Z</published><updated>2009-04-10T10:00:04Z</updated><content type="html">&lt;p&gt;I’ve been hearing a lot of questions recently about what things you can do with advanced functions.&amp;#160; People seem to be aching for good examples of using PowerShell V2 functions, and, since I’ve discovered a few handy tricks for advanced functions, I thought I’d start to share them there in a series called “Fun with Parameter Binding.”&lt;/p&gt;  &lt;p&gt;Here’s volume one: &lt;em&gt;The Fake Parameter Set Trick&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;I found myself wanting to make an advanced function that took something strongly typed (in this case, the CommandInfo object, which is the base object for what you see when you run Get-Command) from the pipeline and returned items that matched a certain characteristic.&amp;#160; If I didn’t pipeline in any items, I wanted to get all of the commands and check for the same characteristic.&lt;/p&gt;  &lt;p&gt;What I really wanted was the function to act two ways, one parameterized, one unparameterized (like how you can run Get-Process or Get-Process PowerShell*)&lt;/p&gt;  &lt;p&gt;I know of one way to approach this, using the $psBoundParameters variable (&lt;a href="http://blogs.msdn.com/powershell/archive/2009/04/06/checking-for-bound-parameters.aspx"&gt;see this&lt;/a&gt; enlightening post by Marcel Ortiz Soto), but I recently happened upon another approach that I find kind of novel.&amp;#160; I call it the fake parameter set trick.&lt;/p&gt;  &lt;p&gt;Here’s an example:&lt;/p&gt;  &lt;pre class="PowerShellColorizedScript"&gt;&lt;span style="color: #a9a9a9"&gt;[&lt;/span&gt;&lt;span style="color: #add8e6"&gt;CmdletBinding&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #000000"&gt;DefaultParameterSetName&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt;&lt;span style="color: #8b0000"&gt;&amp;quot;All&amp;quot;&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;]&lt;/span&gt;            
                
    &lt;span style="color: #00008b"&gt;param&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;            
    &lt;span style="color: #a9a9a9"&gt;[&lt;/span&gt;&lt;span style="color: #add8e6"&gt;Parameter&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #000000"&gt;Mandatory&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt;&lt;span style="color: #ff4500"&gt;$true&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;,&lt;/span&gt;            
        &lt;span style="color: #000000"&gt;ParameterSetName&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt;&lt;span style="color: #8b0000"&gt;&amp;quot;Command&amp;quot;&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;,&lt;/span&gt;            
        &lt;span style="color: #000000"&gt;ValueFromPipeline&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt;&lt;span style="color: #ff4500"&gt;$true&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;]&lt;/span&gt;            
    &lt;span style="color: #008080"&gt;[Management.Automation.CommandInfo]&lt;/span&gt;            
    &lt;span style="color: #ff4500"&gt;$command&lt;/span&gt;            
    &lt;span style="color: #000000"&gt;)&lt;/span&gt;            
                
    &lt;span style="color: #00008b"&gt;process&lt;/span&gt; &lt;span style="color: #000000"&gt;{&lt;/span&gt;            
        &lt;span style="color: #ff4500"&gt;$psCmdlet&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;ParameterSetName&lt;/span&gt;               
    &lt;span style="color: #000000"&gt;}&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;The CmdletBinding attribute at the top of the function is one of the markers that the function is an advanced function, and it specifies the DefaultParameterSetName.&amp;#160; If no default parameter set name is specified, it would go ahead and default to whichever ParameterSetName it found on a parameter.&amp;#160; If you didn’t every mention a ParameterSetName, then the parameter set name would implicitly be __AllParameterSets.&lt;/p&gt;

&lt;p&gt;In my case, I’ve set the DefaultParameterSetName to All.&amp;#160; But there aren’t any parameters at all in All.&amp;#160; In fact, for All intents and purposes, All is nothing.&amp;#160; All is a fake parameter set.&lt;/p&gt;

&lt;p&gt;This lets me mark the $command parameter as mandatory and from pipeline, and lets me easily figure out if the parameter is there or not.&amp;#160; This is ideal for building good Get- advanced functions, because Get- cmdlets and functions tend to either be able to retrieve all of the data or retrieve a filtered subset of the data.&lt;/p&gt;

&lt;p&gt;Hope this Helps,&lt;/p&gt;

&lt;p&gt;James Brundage&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9542628" width="1" height="1"&gt;</content><author><name>JamesBrundage</name><uri>http://blogs.msdn.com/JamesBrundage/ProfileUrlRedirect.ashx</uri></author><category term="Microcode" scheme="http://blogs.msdn.com/b/mediaandmicrocode/archive/tags/Microcode/" /><category term="Scripting Tricks" scheme="http://blogs.msdn.com/b/mediaandmicrocode/archive/tags/Scripting+Tricks/" /><category term="Fun With Parameter Binding" scheme="http://blogs.msdn.com/b/mediaandmicrocode/archive/tags/Fun+With+Parameter+Binding/" /></entry><entry><title>Microcode: A Quick Trick to turn regular XML into Xaml</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/mediaandmicrocode/archive/2009/01/22/microcode-a-quick-trick-to-turn-regular-xml-into-xaml.aspx" /><id>http://blogs.msdn.com/b/mediaandmicrocode/archive/2009/01/22/microcode-a-quick-trick-to-turn-regular-xml-into-xaml.aspx</id><published>2009-01-22T13:07:36Z</published><updated>2009-01-22T13:07:36Z</updated><content type="html">&lt;p&gt;MSDN has tons of examples about XAML.&amp;nbsp; Nearly everything in WPF has an example in XAML, but not all of these XAML examples actually reference the namespace that is required for this Xaml to be loadable by WPF.&amp;nbsp; It's still valid XML, just not valid XAML.&lt;/p&gt; &lt;p&gt;Here's a quick example of what I mean.&amp;nbsp; I just copied and pasted this chunk from the MSDN topic on &lt;a href="http://msdn.microsoft.com/en-us/library/system.windows.media.lineargradientbrush.aspx"&gt;LinearGradientBrush&lt;/a&gt;:&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&amp;lt;!-- This rectangle is painted with a diagonal linear gradient. --&amp;gt;&lt;br&gt;&amp;lt;Rectangle Width="200" Height="100"&amp;gt;&lt;br&gt;&amp;nbsp; &amp;lt;Rectangle.Fill&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;LinearGradientBrush StartPoint="0,0" EndPoint="1,1"&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;GradientStop Color="Yellow" Offset="0.0" /&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;GradientStop Color="Red" Offset="0.25" /&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;GradientStop Color="Blue" Offset="0.75" /&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;GradientStop Color="LimeGreen" Offset="1.0" /&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/LinearGradientBrush&amp;gt;&lt;br&gt;&amp;nbsp; &amp;lt;/Rectangle.Fill&amp;gt;&lt;br&gt;&amp;lt;/Rectangle&amp;gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;Now if I try to simply load that up as XAML, XamlReader barfs&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;$x&amp;nbsp; =[xml]'&amp;lt;!-- This rectangle is painted with a diagonal linear gradient. --&amp;gt;&lt;br&gt;&amp;lt;Rectangle Width="200" Height="100"&amp;gt;&lt;br&gt;&amp;nbsp; &amp;lt;Rectangle.Fill&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;LinearGradientBrush StartPoint="0,0" EndPoint="1,1"&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;GradientStop Color="Yellow" Offset="0.0" /&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;GradientStop Color="Red" Offset="0.25" /&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;GradientStop Color="Blue" Offset="0.75" /&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;GradientStop Color="LimeGreen" Offset="1.0" /&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/LinearGradientBrush&amp;gt;&lt;br&gt;&amp;nbsp; &amp;lt;/Rectangle.Fill&amp;gt;&lt;br&gt;&amp;lt;/Rectangle&amp;gt;&lt;br&gt;'  &lt;p&gt;[Windows.Markup.XamlReader]::Parse($x.OuterXml)&lt;/p&gt;&lt;/blockquote&gt; &lt;blockquote&gt; &lt;p style="color: red"&gt;Exception calling "Parse" with "1" argument(s): "'' XML namespace prefix does not map to a namespace URI, so cannot resolve property 'Width'. Line '1' Position '79'."&lt;br&gt;At line:14 char:35&lt;br&gt;+ [Windows.Markup.XamlReader]::Parse &amp;lt;&amp;lt;&amp;lt;&amp;lt; ($x.OuterXml)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; + CategoryInfo&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : NotSpecified: (:) [], MethodInvocationException&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; + FullyQualifiedErrorId : DotNetMethodException&lt;pre&gt;&lt;/pre&gt;&lt;/blockquote&gt;
&lt;p&gt; Obviously, that's not ideal.&amp;nbsp; Luckily, with CTP3, there's a cmdlet called Select-Xml, which will allow me to query a document with xPath, regardless of namespaces.&lt;/p&gt;
&lt;p&gt;This means that I can check to see if the fist element has a reference to the WPF namespace, and add it if it's not there.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;$t = $x |&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Select-Xml //* | &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Select-Object -First 1 | &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Foreach-Object {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (-not $_.Node.xmlns) {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $_.Node.SetAttribute("xmlns", '&lt;a href="http://schemas.microsoft.com/winfx/2006/xaml/presentation')"&gt;http://schemas.microsoft.com/winfx/2006/xaml/presentation')&lt;/a&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $_.Node.OuterXml&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;I'll stop and explain this pipeline a little.&amp;nbsp; $x is the XML, I pipe it into Select-Xml, with the xPath parameter of //*.&amp;nbsp; //* roughly translates to any node.&amp;nbsp; I pick out the first node (with Select-Object -first 1) and then I check to see if the Node contains an xmlns attribute.&amp;nbsp; If it doesn't, I add it.&amp;nbsp; Either way, I emit the first node's OuterXml, which basically means I emit the entire XML chunk as text.&amp;nbsp; That's what $t is when I am done.
&lt;p&gt;Then I use this chunk to display it:
&lt;blockquote&gt;
&lt;p&gt;$w = New-Object Windows.Window&lt;br&gt;$w.Content = [Windows.Markup.XamlReader]::Parse($t)&lt;br&gt;$w.SizeToContent = "WidthAndHeight"&lt;br&gt;$w.ShowDialog()&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Now I have the MSDN sample working, regardless of if it had an xmlns attribute in the first place.&lt;/p&gt;
&lt;p&gt;Hope this Helps,&lt;/p&gt;
&lt;p&gt;James Brundage [MSFT]&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9365908" width="1" height="1"&gt;</content><author><name>JamesBrundage</name><uri>http://blogs.msdn.com/JamesBrundage/ProfileUrlRedirect.ashx</uri></author><category term="Microcode" scheme="http://blogs.msdn.com/b/mediaandmicrocode/archive/tags/Microcode/" /><category term="Select-Object" scheme="http://blogs.msdn.com/b/mediaandmicrocode/archive/tags/Select_2D00_Object/" /><category term="WPF" scheme="http://blogs.msdn.com/b/mediaandmicrocode/archive/tags/WPF/" /><category term="Select-Xml" scheme="http://blogs.msdn.com/b/mediaandmicrocode/archive/tags/Select_2D00_Xml/" /></entry><entry><title>Media: The Moment Obama Got Inaugurated and PhotoSynth Hit Mainstream</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/mediaandmicrocode/archive/2009/01/20/media-the-moment-obama-got-inaugurated-and-photosynth-hit-mainstream.aspx" /><id>http://blogs.msdn.com/b/mediaandmicrocode/archive/2009/01/20/media-the-moment-obama-got-inaugurated-and-photosynth-hit-mainstream.aspx</id><published>2009-01-20T23:12:34Z</published><updated>2009-01-20T23:12:34Z</updated><content type="html">&lt;p&gt;&lt;a href="http://photosynth.net/"&gt;Photosynth&lt;/a&gt; is a really cool product out of live labs.&amp;#160; It's sort of an uber photo collage application.&amp;#160; It takes photos taken from different people, at different resolutions and different times, and collects them into a 3d view of a location that you can navigate around.&lt;/p&gt;  &lt;p&gt;CNN.com worked with Photosynth to show the world the Moment of Obama's Inauguration.&amp;#160; It's a pretty cool way to view history.&lt;/p&gt;  &lt;p&gt;Check it out:&lt;/p&gt;  &lt;p&gt;&lt;a title="http://www.cnn.com/SPECIALS/2009/44.president/inauguration/themoment/" href="http://www.cnn.com/SPECIALS/2009/44.president/inauguration/themoment/"&gt;http://www.cnn.com/SPECIALS/2009/44.president/inauguration/themoment/&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Hope this Helps,&lt;/p&gt;  &lt;p&gt;James Brundage [MSFT]&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9350720" width="1" height="1"&gt;</content><author><name>JamesBrundage</name><uri>http://blogs.msdn.com/JamesBrundage/ProfileUrlRedirect.ashx</uri></author><category term="Media" scheme="http://blogs.msdn.com/b/mediaandmicrocode/archive/tags/Media/" /><category term="Photosynth" scheme="http://blogs.msdn.com/b/mediaandmicrocode/archive/tags/Photosynth/" /></entry><entry><title>PowerScripting Podcast Online</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/mediaandmicrocode/archive/2009/01/19/powerscripting-podcast-online.aspx" /><id>http://blogs.msdn.com/b/mediaandmicrocode/archive/2009/01/19/powerscripting-podcast-online.aspx</id><published>2009-01-20T00:44:35Z</published><updated>2009-01-20T00:44:35Z</updated><content type="html">&lt;p&gt;My interview with the PowerScripting Podcast is now online.&amp;#160; Check it out:&lt;/p&gt;  &lt;p&gt;&lt;a title="http://powerscripting.wordpress.com/2009/01/18/episode-55-jeff-hicks-in-for-hal-and-an-interview-with-james-brundage/" href="http://powerscripting.wordpress.com/2009/01/18/episode-55-jeff-hicks-in-for-hal-and-an-interview-with-james-brundage/"&gt;http://powerscripting.wordpress.com/2009/01/18/episode-55-jeff-hicks-in-for-hal-and-an-interview-with-james-brundage/&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Hope this helps,&lt;/p&gt;  &lt;p&gt;James Brundage [MSFT]&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9340839" width="1" height="1"&gt;</content><author><name>JamesBrundage</name><uri>http://blogs.msdn.com/JamesBrundage/ProfileUrlRedirect.ashx</uri></author></entry><entry><title>Please Join Me for a Power Scripting Podcast Tonight @ 9PM EST (6PM PST)</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/mediaandmicrocode/archive/2009/01/15/please-join-me-for-a-power-scripting-podcast-tonight-9pm-est-6pm-pst.aspx" /><id>http://blogs.msdn.com/b/mediaandmicrocode/archive/2009/01/15/please-join-me-for-a-power-scripting-podcast-tonight-9pm-est-6pm-pst.aspx</id><published>2009-01-15T21:30:11Z</published><updated>2009-01-15T21:30:11Z</updated><content type="html">&lt;p&gt;I’m going to be doing a PowerScripting Podcast tonight @ 9PM EST.&amp;#160; There’s a live chat room where you can ask questions and pick the brains of a tester / avid scripter on the PowerShell team.&lt;/p&gt;  &lt;p&gt;It should be fun.&amp;#160; I hope to see your questions there.&lt;/p&gt;  &lt;p&gt;&lt;a title="http://powerscripting.wordpress.com/2009/01/14/tomorrow-on-powerscripting-live-james-brundage/" href="http://powerscripting.wordpress.com/2009/01/14/tomorrow-on-powerscripting-live-james-brundage/"&gt;http://powerscripting.wordpress.com/2009/01/14/tomorrow-on-powerscripting-live-james-brundage/&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Hope this Helps,&lt;/p&gt;  &lt;p&gt;James Brundage [MSFT]&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9321313" width="1" height="1"&gt;</content><author><name>JamesBrundage</name><uri>http://blogs.msdn.com/JamesBrundage/ProfileUrlRedirect.ashx</uri></author></entry><entry><title>Media: The Future of Newspapers is Pay For Play Journalism?</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/mediaandmicrocode/archive/2008/12/28/media-the-future-of-newspapers-is-pay-for-play-journalism.aspx" /><id>http://blogs.msdn.com/b/mediaandmicrocode/archive/2008/12/28/media-the-future-of-newspapers-is-pay-for-play-journalism.aspx</id><published>2008-12-28T03:45:35Z</published><updated>2008-12-28T03:45:35Z</updated><content type="html">&lt;p&gt;I love my news.&amp;#160; For whatever reason, I find catching up on the world to be one of the most relaxing and rewarding things you can do in your spare time.&amp;#160; Even though I like to read the news, I rarely read a physical newspaper or magazine or watch a news program .&amp;#160; My cell phone and web browser are my gateways to the news world.&amp;#160; I make an exception for especially good local weeklies (Seattle's &lt;a href="http://www.thestranger.com/"&gt;The Stranger&lt;/a&gt;) and very insightful magazines with a broad range of news ( like &lt;a href="http://www.economist.com/"&gt;The Economist&lt;/a&gt; ).&amp;#160; But times are tough for newspapers and magazines alike.&amp;#160; Local small-market newspapers are dropping like flies, and even big outfits like &lt;a href="http://www.nytimes.com/"&gt;The New York Times&lt;/a&gt; are struggling.&amp;#160; Digitization has been a painfully slow paradigm shift with major publications.&lt;/p&gt;  &lt;p&gt;This is primarily because of a loss in advertising revenue on many fronts.&amp;#160; It's harder to convince a businessman to buy a 6&amp;quot; ad for hundreds of dollars upfront with limited tracking and return when they can buy a search keyword for a fraction of that.&amp;#160; It's also very hard to convince someone to put a classified ad in at a dollar a word when &lt;a href="http://www.craigslist.org/"&gt;Craigslist&lt;/a&gt; will do it for free.&amp;#160; So it's no suprise that there have been any number of propositions about &amp;quot;the future of newspapers.&amp;quot;&amp;#160; Most are still advertising focused,&amp;#160; and the general mind set in publishing still seems to ignore what happens when &lt;a href="http://en.wikipedia.org/wiki/The_Long_Tail"&gt;the Long Tail effect&lt;/a&gt; hits news and ignoring the peril of wire services.&amp;#160; By this I mean that if finding the news I am interested in is no longer restricted by where I am, then I'll end up reading publications from wherever news comes that interests me, and it becomes harder for any publication to really gain a mental foothold.&amp;#160; Further more, if every time I pick up a newspaper, 80% of the content comes from a news wire service, then that newspaper is no different from any other newspaper I'd run across, and I'm no more or less likely to pick it up in the future.&lt;/p&gt;  &lt;p&gt;This is a very tricky situation, that presents no great way out.&amp;#160; But today, I ran across a way that is so worrisomely bad that I've decided to talk about it here.&lt;/p&gt;  &lt;p&gt;Ironically, I ran this very bad answer to the problems newspapers are facing on &lt;a href="http://www.good.is/"&gt;Good&lt;/a&gt;, through a link on MSN title &lt;a href="http://www.good.is/?p=14300&amp;amp;GT1=34127"&gt;&amp;quot;When Newspapers Are Gone&amp;quot;&lt;/a&gt;.&amp;#160; This is an article about a web site called &lt;a href="http://www.spot.us/"&gt;Spot.Us&lt;/a&gt;, where a few community minded individuals pay a reporter to write a news story.&amp;#160; &lt;/p&gt;  &lt;p&gt;In my personal opinion, this is a very, very bad idea.&lt;/p&gt;  &lt;p&gt;Why?&lt;/p&gt;  &lt;p&gt;First and foremost, it's &amp;quot;pay for play&amp;quot; journalism.&amp;#160; If this is the future of news, then the future of news will mean that people who cannot afford to be covered will not be.&amp;#160; What's that mean?&amp;#160; Well, unless you get a lot of donations from a lot of people, no coverage of any danger zone, so most likely no international coverage whatsoever.&amp;#160; If this sort of news becomes popular, than suffering becomes a &amp;quot;tree falls in a forest&amp;quot; problem.&amp;#160; If 1,000 people are killed in an earthquake due to shoddy infrastructure, and no one can afford to report on it, do their deaths mean anything?&lt;/p&gt;  &lt;p&gt;The second problem is what I call NIMBY journalism (NIMBY is &lt;em&gt;Not In My Backyard&lt;/em&gt;).&amp;#160; An individual can provide up to 20% of the amount required to cover a story, which means that a small group of individuals can fund a story of their own liking. Don't like that eyesore building going up across the street?&amp;#160; Pool 5 of your neighbors and have someone you've never met run a news story about the decline and fall of your neighborhoods look.&amp;#160; Concerned about increasing homelessness in your area?&amp;#160; Fund an article pushing for a homeless shelter far away.&lt;/p&gt;  &lt;p&gt;The third problem is funding transparency.&amp;#160; If only a few people can fund a story on Spot.Us, which pitches the story to other major outlets, then it's possible to get stories written that back up your political beliefs.&amp;#160; While Spot.Us does have &amp;quot;fact-checking editors&amp;quot; (a freelance journalist can turn down the first two if they choose), there's little on who watches the watchdogs, less on how retractions work, and nothing that I can see that would prevent individuals with different political slants from funding a story.&amp;#160; As the story is picked up by other outlets, both patent lies and innuendo can seep into the news cycle with a significantly greater pedigree than information recycled from blogs.&amp;#160; While you can see the individuals that sponsored the article on Spot.Us, you do not have any information about their affiliations with companies, and it's unlikely that whoever would pick up a story from Spot.Us would list the individuals who paid for the article.&lt;/p&gt;  &lt;p&gt;The fourth problem is that pitch-based news doesn't come up with the news no one wants to hear.&amp;#160; A simple and sarcastic example of this was my time (12 years) writing film reviews.&amp;#160; During this time, I saw a lot of movies I suspected would be awful, not because I particularly wanted to, but because &lt;em&gt;someone &lt;/em&gt;has to and my editor gave me marching orders to cover the movies.&amp;#160; Some of them were awful, some of them were unexpectedly great. When journalists do their own pitching of stories entirely, the editorial process is greatly degraded, because people simply do not go out to cover many things, like violent crime (or exceedingly bad movies), without being told to do so.&amp;#160; Sometimes the best stories start from the most mundane pieces of information.&lt;/p&gt;  &lt;p&gt;The fifth problem is the transparency in the expenses of a story.&amp;#160; Salaried employees of a newspaper can sometimes expense costs of the story to a newspaper, but there is a lot of transparency in the process.&amp;#160; Receipts must be kept.&amp;#160; Purchases must be justified.&amp;#160; As much as I wish journalists were paid better for their work, I do not believe that they should be their own accountants or set all of their own rates.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.spot.us/news_items"&gt;A quick look of the story pitches on Spot.Us&lt;/a&gt; gives a lot of foundation for these concerns.&amp;#160;&amp;#160; Right now, I see a pitch about problems with state adopted children ($500 required), a pitch about a retirement community residents who had to resign from a community board because they formed their own online paper ($25 required), a pitch about why the VOA takes too long to process claims ($1000), a pitch to cover the poor in San Francisco ($500), a pitch about the digital future of Bay Area newspapers ($1000), a pitch about the electricity sources in the Bay Area ($1500), a pitch about if Oakland can survive the next quake ($450), and a pitch about how the recession is hitting bay area hookers ($500).&amp;#160; Each of these pitches raises a lot of questions about what the money's being spent on (especially the last one) and why the rates are so wildly different.&amp;#160; I'd go out on a limb and guess that the community board pitch ($25) is someone who wants to give more legitimacy to their community association dispute.&amp;#160; That there's even a pitch for a digitization of news story on an online news site raises obvious conflict of interest questions.&amp;#160; Several of the stories seem wildly overvalued, and others incredibly under expensed (how can someone assess is Oakland is ready for the next quake for $450?).&amp;#160; Magazines with great readership (hundreds of thousands or even millions) will generally not pay more than a few thousand dollars a story to a freelancer.&amp;#160; Why is a story that can be researched from a laptop while sipping a latte worth $1000?&lt;/p&gt;  &lt;p&gt;I apologize to veer off my normal course of technical information and highlighting interesting information that I find online, but the idea of journalism as funded by the angry mob makes me very worried.&amp;#160; Journalism should help the mob become incensed about what they do not know, not become the voice of the angry mob to recruit more members.&amp;#160; Journalists should calm the mob when it is irrationally angry, and not owe their paycheck to the mob.&amp;#160; Journalists should show be a check and balance to the world, instead of balancing their checkbooks by what their neighborhood says is right.&lt;/p&gt;  &lt;p&gt;Hope this Helps,&lt;/p&gt;  &lt;p&gt;James Brundage [MSFT]&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9254644" width="1" height="1"&gt;</content><author><name>JamesBrundage</name><uri>http://blogs.msdn.com/JamesBrundage/ProfileUrlRedirect.ashx</uri></author><category term="Media" scheme="http://blogs.msdn.com/b/mediaandmicrocode/archive/tags/Media/" /></entry></feed>