<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>Technical How-To's</title>
        <link>http://geekswithblogs.net/coredump/category/6961.aspx</link>
        <description>Technical How-To's</description>
        <language>en-US</language>
        <copyright>Russell Ball</copyright>
        <managingEditor>rt_ball@yahoo.com</managingEditor>
        <generator>Subtext Version 0.0.0.0</generator>
        <item>
            <title>Puzzling Issue Involving Reflection and MbUnit</title>
            <link>http://geekswithblogs.net/coredump/archive/2007/12/21/117907.aspx</link>
            <description>&lt;p style="font-family: arial;"&gt;&lt;font size="2"&gt;I just sent the following email to the &lt;a href="http://blogs.msdn.com/bclteam/default.aspx"&gt;BCL (Base Class Library) Team Blog&lt;/a&gt; email address in hopes of getting some insight into a weird problem we've been having. &lt;/font&gt;&lt;/p&gt;
&lt;blockquote style="font-family: arial;"&gt;
&lt;p&gt;&lt;font size="2"&gt;I was hoping you could give me some general guidance on how Type.GetProperties() determines the sequence of the PropertyInfo objects it returns. &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;I just ran across this &lt;a href="http://msdn2.microsoft.com/en-us/library/kyaxdd3x.aspx"&gt;remark&lt;/a&gt; on MSDN about the order that Type.GetProperties() returns PropertyInfo objects&lt;/font&gt;&lt;/p&gt;
&lt;/blockquote&gt;  &lt;blockquote style="font-family: arial;"&gt;
&lt;p style="margin-left: 40px;"&gt;&lt;font size="2"&gt;&lt;strong&gt;The &lt;/strong&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/6kec8wwk.aspx"&gt;&lt;strong&gt;GetProperties&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt; method does not return properties in a particular order, such as alphabetical or declaration order. Your code must not depend on the order in which properties are returned, because that order varies.&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;
&lt;/blockquote&gt;  &lt;blockquote style="font-family: arial;"&gt;
&lt;p&gt;&lt;font size="2"&gt;We have parsing code that uses the 1.1 framework which is dependent on the order in which properties are returned. It fails intermittently when run as part of a suite of MbUnit tests. After seeing this msdn remark, I changed the code to remove the sequence dependency and the MbUnit intermittent failure problem disappeared. This led me to believe that properties were sometimes being returned in an order other than what we expected (the order they were declared in the code files). &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;Normally we are not allowed to make production changes this time of the year unless the issue is critical, so we are trying to determine the likelihood of this causing production issues. The problem is that we get contradictory results based on how we test this. If I wrap the method in a hundred thousand loop iteration, then I can’t reproduce the error in MbUnit. The properties always return in the order in which they are declared in the class file. However, if I run the whole suite of tests several times in succession, then I receive random errors that seem to derive from the sequence being returned in a different order.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;Is there some internal algorithm that might trigger a different sequential order to be generated based on some unique condition that running the whole MbUnit suite of tests as opposed to running them in a large loop would cause (i.e. a certain number of threads or memory/cpu pressure)?&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;Any insight you could offer in this problem would be greatly appreciated.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;Thank you,&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;Russell Ball&lt;/font&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p style="font-family: arial;"&gt;&lt;font size="2"&gt;Does anyone else have any ideas?&lt;/font&gt;&lt;/p&gt;
&lt;p style="font-family: arial;"&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p style="font-family: arial;"&gt;&lt;font size="2"&gt;&lt;strong&gt;** Update **&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p style="font-family: arial;"&gt;&lt;font size="2"&gt;We no longer get these failures in MbUnit if we revert it to the 1.1 framework by changing the supported frameworks node in the config file as described &lt;a href="http://www.mertner.com/confluence/display/MbUnit/RunningMbUnitWithDotNetFramework11"&gt;here&lt;/a&gt;. I'm guessing they changed the algorithm in the 2.0 framework that is used to determine the sequence.&lt;/font&gt;&lt;/p&gt;
&lt;p style="font-family: arial;"&gt;&lt;font size="2"&gt;That still doesn't explain why there is a difference between calling our code in a massive loop versus calling it as part of a suite of tests, but at least it puts our minds at ease with respect to the risk of intermittent failures occurring in our current production code.&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=117907"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=117907" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/coredump/aggbug/117907.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Russell Ball</dc:creator>
            <guid>http://geekswithblogs.net/coredump/archive/2007/12/21/117907.aspx</guid>
            <pubDate>Fri, 21 Dec 2007 16:09:55 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/coredump/comments/117907.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/coredump/archive/2007/12/21/117907.aspx#feedback</comments>
            <slash:comments>5</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/coredump/comments/commentRss/117907.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/coredump/services/trackbacks/117907.aspx</trackback:ping>
        </item>
        <item>
            <title>Friends Don't Let Friends Use the Start Menu</title>
            <link>http://geekswithblogs.net/coredump/archive/2007/12/15/117732.aspx</link>
            <description>&lt;p style="font-family: Arial;"&gt;&lt;font size="2"&gt;I've read and listened to &lt;a href="http://www.hanselman.com/blog/"&gt;Scott Hanselman&lt;/a&gt; sing the praises of &lt;a href="http://www.bayden.com/SlickRun/"&gt;SlickRun&lt;/a&gt; for a long time, but I just recently got around to using it. &lt;/font&gt;&lt;/p&gt;
&lt;p style="font-family: Arial;"&gt;&lt;font size="2"&gt;For those of you who are as slow to catch on as me, it is essentially just a tricked-out version of the Run window that allows you launch programs &lt;span style="font-weight: bold;"&gt;much faster than you can through the traditional hide-and-seek start menu approach&lt;/span&gt;. This is especially true if you are a tool addict and have a start menu that stretches across your screen. &lt;/font&gt;&lt;/p&gt;
&lt;p style="font-family: Arial;"&gt;&lt;font size="2"&gt;Best of all, &lt;span style="font-weight: bold;"&gt;it is FREE&lt;/span&gt;, which is one of the few things that still fits into my budget these days. It also only takes seconds to grok and begin saving time with it.&lt;/font&gt;&lt;/p&gt;
&lt;p style="font-family: Arial;"&gt;&lt;font size="2"&gt;To get started, all you have to do is right-click on the floating SlickRun textbox and select "New Magic Word". When the dialog box with the nifty wizard hat pops up, &lt;span style="font-weight: bold;"&gt;you simply drag the magic geen lightsaber&lt;/span&gt; circled below over to an open program and it will figure out the program's filepath. You can also create the mapping by just &lt;span style="font-weight: bold;"&gt;dragging a shortcut from the start menu&lt;/span&gt; on to the floating SlickRun textbox prompt.&lt;/font&gt;&lt;/p&gt;
&lt;p style="font-family: Arial;"&gt;&lt;font size="2"&gt;&lt;img vspace="10" hspace="10" alt="" src="http://farm3.static.flickr.com/2289/2111387881_3eab512e5a.jpg?v=0" /&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p style="font-family: Arial;"&gt;&lt;font size="2"&gt;Next, you think of a clever and creative keyword (for example NCoverExplorer for NCoverExplorer) and then optionally assign paramters to it. Parameters are cool because you can do things like &lt;span style="font-weight: bold;"&gt;open FireFox and surf to your favorite porn site in one swift and efficient motion&lt;/span&gt;. For NCoverExplorer, I set the parameter value to the path of the NCover xml result file that gets generated from our automated build process. &lt;/font&gt;&lt;/p&gt;
&lt;p style="font-family: Arial;"&gt;&lt;font size="2"&gt;Finally, thanks to the magic of intellisense, you just have to type a couple of letters until the keyword you want appears in the textbox and then hit return in order to launch it. Easy, huh?&lt;br /&gt;
&lt;/font&gt;&lt;/p&gt;
&lt;p style="font-family: Arial;"&gt;&lt;font size="2"&gt;&lt;img width="500" vspace="10" hspace="10" height="189" alt="" src="http://farm3.static.flickr.com/2244/2112310438_06720cc58a.jpg?v=0" /&gt;&lt;/font&gt; &lt;/p&gt;
&lt;p style="font-family: Arial;"&gt;&lt;font size="2"&gt;Just remember, REAL geeks don't use the start menu. If you don't want all the other geeks laughing at you and kicking silicon dust in your face in the computer lab, then I suggest you download SlickRun immediately. &lt;br /&gt;
&lt;/font&gt;&lt;/p&gt;
&lt;br /&gt;
&lt;p style="font-family: Arial;"&gt;&lt;font size="2"&gt;&lt;strong&gt;Helpful Configuration Hints&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;
&lt;ul style="font-family: Arial;"&gt;
    &lt;li&gt;&lt;font size="2"&gt;If you're used to Windows-R to launch programs, you can change the default SlickRun hotkey (Windows-Q) to this more familiar one by setting GrabWinR=1 in the slickRun.ini. You can find this config file in your computer's app data directory (directory locations vary based on the OS), but it won't actually be created until you close SlickRun for the first time. &lt;/font&gt;&lt;/li&gt;
    &lt;li&gt;&lt;font size="2"&gt;I also like turning the ChaseCursor option on so that launcher window pops up where ever your cursor happens to be after hitting the hotkey combination. This saves me from having to shift my focus to a different part of the screen... Yes, I know that it seems lazy beyond words to recommend a feature just because it saves my eyeballs from having to move a few centimeters.&lt;/font&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p style="font-family: Arial;"&gt;&lt;font size="2"&gt;&lt;strong&gt;Notes about Vista&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;
&lt;ul style="font-family: Arial;"&gt;
    &lt;li&gt;&lt;font size="2"&gt;SlickRun is not quite as compelling on Vista because of the built in launcher in the Vista start menu. However, I still like using it on Vista because it offers more flexibility in terms of creating more logical words for program names as well as automatically passing in parameters to the program.&lt;/font&gt;&lt;/li&gt;
    &lt;li&gt;&lt;font size="2"&gt;Setting up magic words by dragging shortcuts from the start menu to the SlickRun prompt doesn't work on Vista for some reason.&lt;/font&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;font size="2"&gt;&lt;span style="font-weight: bold; font-family: Arial;"&gt;Interesting SlickRun Factoid&lt;br /&gt;
&lt;/span&gt;&lt;/font&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;font size="2"&gt;&lt;span style="font-family: Arial;"&gt;This was actually written in Delphi. I'm going to let you come up with your own Delphi jokes so as to avoid any hate mail from either one of the remaining Delphi programmers out there. &lt;br /&gt;
    &lt;/span&gt;&lt;/font&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt; &lt;a href="http://reddit.com/submit?url=http://geekswithblogs.net/coredump/archive/2007/12/15/117732.aspx&amp;amp;title=Friends+Don%27t+Let+Friends+Use+the+Start+Menu++"&gt;&lt;img src="http://webhelperbrowser.com/i/reddit.gif" alt="add to Reddit" /&gt;&lt;/a&gt; &lt;a href="http://digg.com/submit?phase=2&amp;amp;url=http://geekswithblogs.net/coredump/archive/2007/12/15/117732.aspx"&gt;&lt;img src="http://webhelperbrowser.com/i/digg.gif" alt="digg it" /&gt;&lt;/a&gt; &lt;a href="http://del.icio.us/post?url=http://geekswithblogs.net/coredump/archive/2007/12/15/117732.aspx&amp;amp;title=Friends+Don%27t+Let+Friends+Use+the+Start+Menu++"&gt;&lt;img src="http://webhelperbrowser.com/i/delicious.gif" alt="add to del.icio.us" /&gt;&lt;/a&gt; &lt;a href="http://technorati.com/faves?sub=addfavbtn&amp;amp;add=http://geekswithblogs.net/coredump"&gt;&lt;img alt="Add to Technorati Favorites" src="http://static.technorati.com/pix/fave/btn-fave2.png" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=117732"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=117732" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/coredump/aggbug/117732.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Russell Ball</dc:creator>
            <guid>http://geekswithblogs.net/coredump/archive/2007/12/15/117732.aspx</guid>
            <pubDate>Sat, 15 Dec 2007 06:35:48 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/coredump/comments/117732.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/coredump/archive/2007/12/15/117732.aspx#feedback</comments>
            <slash:comments>4</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/coredump/comments/commentRss/117732.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/coredump/services/trackbacks/117732.aspx</trackback:ping>
        </item>
        <item>
            <title>Don't Forget to Verigoogle</title>
            <link>http://geekswithblogs.net/coredump/archive/2007/09/17/115421.aspx</link>
            <description>&lt;p&gt;&lt;span style="font-family: Arial;"&gt;&lt;font size="2"&gt;I knew that SQL Server 2005 had structured exception handling, but for some reason I assumed that you could only use it within CLR sprocs. Since I still haven't actually heard of anyone using CLR sprocs for anything other than demos or sample projects (at least not without being pummeled by hoards of angry DBA's), I mostly ignored this new feature until now. &lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;&lt;span style="font-family: Arial;"&gt;Today I worked on a sproc that involved over a dozen DML statements (it was a utility sproc to handle security and setup steps for developers as part of our build process, so there is no need to chastise me about it being bad design to have so much logic in the database). The thought of copy-pasting dozens of tedious procedural error handling code snippets was so distasteful to me that I decided to do a quick verigoogle. Verigoogling is my freshly coined word for challenging one of my assumptions through google. &lt;/span&gt;&lt;span style="font-family: Arial;"&gt;I was delighted to discover that this new Try/Catch syntax is available to the masses to be used in plain vanilla sprocs. Instead of &lt;/span&gt;&lt;span style="font-family: Arial;"&gt;checking the @@error variable after each statement, we can now be lazy..er..I mean concise and consolidate all the error handling code into the catch block like we're used to doing in good ole' OOP code. &lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;&lt;span style="font-family: Arial;"&gt;For those of you like me who haven't been taking advantage of this new feature yet, here is some sample code that demonstrates the how easy it is to use. As for the rest of you, please restrain yourself for making fun of me and go verigoogle one of your own assumptions.&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal;"&gt;&lt;font size="2"&gt;&lt;span style="font-size: 8pt; color: blue; font-family: 'Arial','sans-serif';"&gt;BEGIN&lt;/span&gt;&lt;span style="font-size: 8pt; font-family: 'Arial','sans-serif';"&gt; &lt;span style="color: blue;"&gt;TRY&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: 'Arial','sans-serif';"&gt;&lt;font size="2"&gt;&lt;span&gt;      &lt;/span&gt;&lt;span style="color: blue;"&gt;BEGIN&lt;/span&gt; &lt;span style="color: blue;"&gt;TRANSACTION&lt;/span&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: 'Arial','sans-serif';"&gt;&lt;font size="2"&gt;&lt;o:p&gt;         &lt;/o:p&gt;&lt;span&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;DELETE&lt;/span&gt; &lt;span style="color: blue;"&gt;FROM&lt;/span&gt; table1&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: 'Arial','sans-serif';"&gt;&lt;font size="2"&gt;&lt;span&gt;   &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;span&gt;       &lt;/span&gt;&lt;span style="color: blue;"&gt;DELETE&lt;/span&gt; &lt;span style="color: blue;"&gt;FROM&lt;/span&gt; table2&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: 'Arial','sans-serif';"&gt;&lt;font size="2"&gt;&lt;span&gt;   &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;span&gt;   &lt;/span&gt;&lt;span style="color: blue;"&gt;COMMIT&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal;"&gt;&lt;font size="2"&gt;&lt;span style="font-size: 8pt; color: blue; font-family: 'Arial','sans-serif';"&gt;END&lt;/span&gt;&lt;span style="font-size: 8pt; font-family: 'Arial','sans-serif';"&gt; &lt;span style="color: blue;"&gt;TRY&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal;"&gt;&lt;font size="2"&gt;&lt;span style="font-size: 8pt; color: blue; font-family: 'Arial','sans-serif';"&gt;BEGIN&lt;/span&gt;&lt;span style="font-size: 8pt; font-family: 'Arial','sans-serif';"&gt; &lt;span style="color: blue;"&gt;CATCH&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: 'Arial','sans-serif';"&gt;&lt;font size="2"&gt;&lt;span&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;IF&lt;/span&gt; &lt;span style="color: fuchsia;"&gt;@@TRANCOUNT&lt;/span&gt; &lt;span style="color: gray;"&gt;&amp;gt;&lt;/span&gt; 0&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;
&lt;span&gt;           &lt;/span&gt;&lt;span&gt;&lt;span style="color: blue;"&gt;ROLLBACK&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; color: blue; font-family: 'Arial','sans-serif';"&gt;&lt;o:p&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;span style="font-size: 8pt; font-family: 'Arial','sans-serif';"&gt;&lt;font size="2"&gt;&lt;span&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;DECLARE&lt;/span&gt; @ErrMsg &lt;span style="color: blue;"&gt;nvarchar&lt;/span&gt;&lt;span style="color: gray;"&gt;(&lt;/span&gt;4000&lt;span style="color: gray;"&gt;),&lt;/span&gt; @ErrSeverity &lt;span style="color: blue;"&gt;int&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;     &lt;/span&gt;&lt;span style="color: blue;"&gt;SELECT&lt;/span&gt; @ErrMsg &lt;span style="color: gray;"&gt;=&lt;/span&gt; &lt;span style="color: fuchsia;"&gt;ERROR_MESSAGE&lt;/span&gt;&lt;span style="color: gray;"&gt;(),&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;     &lt;/span&gt;@ErrSeverity &lt;span style="color: gray;"&gt;=&lt;/span&gt; &lt;span style="color: fuchsia;"&gt;ERROR_SEVERITY&lt;/span&gt;&lt;span style="color: gray;"&gt;()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal;"&gt;&lt;font size="2"&gt;&lt;span style="font-size: 8pt; color: gray; font-family: 'Arial','sans-serif';"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;span style="font-size: 8pt; font-family: 'Arial','sans-serif';"&gt;&lt;span&gt;    &lt;/span&gt;&lt;span style="color: blue;"&gt;RAISERROR&lt;/span&gt;&lt;span style="color: gray;"&gt;(&lt;/span&gt;@ErrMsg&lt;span style="color: gray;"&gt;,&lt;/span&gt; @ErrSeverity&lt;span style="color: gray;"&gt;,&lt;/span&gt; 1&lt;span style="color: gray;"&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;font size="2"&gt;&lt;span style="font-size: 8pt; color: blue; line-height: 115%; font-family: 'Arial','sans-serif';"&gt;END&lt;/span&gt;&lt;span style="font-size: 8pt; line-height: 115%; font-family: 'Arial','sans-serif';"&gt; &lt;span style="color: blue;"&gt;CATCH&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;font size="2"&gt;&lt;span style="font-size: 8pt; line-height: 115%; font-family: 'Arial','sans-serif';"&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt; &lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=115421"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=115421" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/coredump/aggbug/115421.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Russell Ball</dc:creator>
            <guid>http://geekswithblogs.net/coredump/archive/2007/09/17/115421.aspx</guid>
            <pubDate>Tue, 18 Sep 2007 04:36:20 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/coredump/comments/115421.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/coredump/archive/2007/09/17/115421.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/coredump/comments/commentRss/115421.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/coredump/services/trackbacks/115421.aspx</trackback:ping>
        </item>
        <item>
            <title>Confessions of an Aero Addict</title>
            <link>http://geekswithblogs.net/coredump/archive/2007/08/13/114618.aspx</link>
            <description>&lt;p&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;font size="2"&gt;When given a choice between style and substance in software, I usually opt for what I consider to be substantive qualities such as speed, functionality, usability, and cost. Since I never saw a sentence about Vista without the phrase "eye candy", I casually dismissed Microsoft's long-awaited OS release as fluff when it first came out and was in no hurry to jump aboard the upgrade band-wagon. &lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;font size="2"&gt;Well despite my valiant effort at indifference, I am ashamed to admit that I have finally succumbed to the narcotic affects of the Aero and was compelled to upgrade both my work and home PCs to &lt;st1:place w:st="on"&gt;Vista&lt;/st1:place&gt; last week. After less than a week, I now experience acute withdrawal symptoms every time I sign back onto an XP machine and am deprived of my glass translucency goodness. I could talk enthusiastically about some my favorite non-visual features in Vista, such as the pervasive search box (ctrl + esc) that I now use in lieu of Google Desktop to quickly find content and launch programs, but who am I kidding? My name is Russell Ball and I am an eye-candy junkie.&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;font size="2"&gt;For those of you who are weak like me and are considering an upgrade in the near future, here are a few things to keep in mind.&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;&lt;strong&gt;&lt;u&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;At the Office&lt;/span&gt;&lt;/u&gt;&lt;/strong&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;ul type="disc"&gt;
    &lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;font size="2"&gt;If you're going to take advantage of an MSDN license and upgrade your OS well ahead of the crowd, make sure you're nice to the IT Pro group. I got their blessing ahead of time by offering to give them a scouting report of any issues they will likely encounter when trying to upgrade the entire department.  &lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/li&gt;
    &lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;font size="2"&gt;When encountering an application error in Vista, try restarting the app using the right-click 'Run as Admin' option. Several rather cryptic errors have miraculously disappeared after re-opening the app under elevated priviledges. &lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/li&gt;
    &lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;font size="2"&gt;&amp;lt;tongueInCheek&amp;gt;Go paperless&amp;lt;/tongueInCheek&amp;gt;. The IT Pros in my shop are understandably reluctant to risk upgrading drivers on the print server just for me, so I am currently remoting in to the dev box to print documents until I can get someone to punch a whole in the dev domain firewall and let me connect directly to the printer.  &lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/li&gt;
    &lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;font size="2"&gt;Expect to have to spend a little time applying a new service packs and installing new versions of applications. PowerShell requires a new version and Visual Studio and SQL Management Studio both require service pack upgrades before they will properly work on Vista.  &lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/li&gt;
    &lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;font size="2"&gt;Expect a few apps to not work. I had to turn off a visual affect in order to get the UltraMon title bar butttons to show up and shut down the Track-It agents on my machine to stop getting bombarded with error messages. Transcender won't work at all, so I'm having to remote into the development server to take practice tests for my upcoming certification exam. Considering that I probably have a hundred apps installed on my machine, that's really not that bad.&lt;/font&gt;&lt;/span&gt; &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;font size="2"&gt;&lt;strong&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;At Home&lt;/span&gt;&lt;/strong&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;ul type="disc"&gt;
    &lt;li class="MsoNormal" style=""&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;font size="2"&gt;If you have a machine that is more than a few years, just let it go. I had a P4 that worked fine for remoting into the office and web browsing, but it was easier to just spend the $800 at my local computer store for a basic machine than fuss with tracking down incompatible parts as part of the upgrade process. After a quick $150 upgrade for a new video card that supported dual monitors, I found myself with a Windows Experience Score of 4.8 (not bad) and enough RAM, disk space, and processing cycles to power a small third world country.  &lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/li&gt;
    &lt;li class="MsoNormal" style=""&gt;&lt;font size="2"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;span style="font-size: 9pt; font-family: Arial;"&gt;&lt;img width="300" height="178" align="right" alt="" src="http://198.170.232.123/images/windows_vista_aero.jpg" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Arial;"&gt;When your wife sees the bill for the new PC, cast an “Aero Translucent Glass” spell on her. If she isn't fully distracted, try the alt-tab spinning windows trick. If that doesn't work, then try defending yourself with one of the countless left-over non-Vista compliant parts that will soon litter the tech landscape.&lt;/span&gt;&lt;/font&gt; &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;See you at the Vista half-way house. &lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=114618"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=114618" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/coredump/aggbug/114618.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Russell Ball</dc:creator>
            <guid>http://geekswithblogs.net/coredump/archive/2007/08/13/114618.aspx</guid>
            <pubDate>Mon, 13 Aug 2007 17:18:41 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/coredump/comments/114618.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/coredump/archive/2007/08/13/114618.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/coredump/comments/commentRss/114618.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/coredump/services/trackbacks/114618.aspx</trackback:ping>
        </item>
        <item>
            <title>The Open Source Side of Powershell: PSCX</title>
            <link>http://geekswithblogs.net/coredump/archive/2007/07/26/114207.aspx</link>
            <description>&lt;p&gt;&lt;font size="2"&gt;One of my &lt;/font&gt;&lt;a href="http://geekswithblogs.net/coredump/archive/2007/07/15/113943.aspx"&gt;&lt;font size="2"&gt;goals for the next six months&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt; was to contribute to an open source project and I think I've chosen one. I downloaded and installed the &lt;/font&gt;&lt;a href="http://www.codeplex.com/PowerShellCX"&gt;&lt;font size="2"&gt;PowerShell Community Extensions&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt; (a.k.a. pscx) from codeplex a while ago, but I just now got around to really tinkering with the cmdLets and reviewing the source code and scripts. I have to say I'm impressed. Keith Hill and his team of volunteer developers did a first rate job of supplementing version one of Powershell with some really useful cmdlets. I can't wait to dig into the source code some more and figure out how the snap-in model works. &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;Here are a few of my favorite features:&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;Provider:&lt;/font&gt;&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;font size="2"&gt;&lt;u&gt;GAC Provider&lt;/u&gt; - It's a little slow when it first loads up, but it is very helpful to be able to easily navigate around in the GAC and do wildcard searches on version numbers. &lt;/font&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;font size="2"&gt;CmdLets&lt;/font&gt;&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;font size="2"&gt;&lt;u&gt;Get/Stop-TerminalSession&lt;/u&gt; - It seems like every couple of weeks I have to kill a remote terminal services connection on one of our development servers because someone forgot to log off and pushed us over the two simultaneous users limit. This cmdlet is a lot quicker than loading up the administrative GUI and will help make the experience much less aggravating. &lt;/font&gt;&lt;/li&gt;
    &lt;li&gt;&lt;font size="2"&gt;&lt;u&gt;Write-Zip&lt;/u&gt; - This will be very useful addition to backup/archiving scripts. At home, I just did the following: &lt;strong&gt;dir "G:\Music\Radiohead\Pablo Honey" | write-zip&lt;/strong&gt; &lt;/font&gt;&lt;/li&gt;
    &lt;li&gt;&lt;font size="2"&gt;&lt;u&gt;Get-FileVersionInfo&lt;/u&gt; - We just started auto-versioning all of our dll's during our build process and set it up so we can match the version of a dll in production with a build directory on our build server. I'm sure we'll be asked to create some automated way to help auditors figure out the version numbers and this will definitely help.  &lt;/font&gt;&lt;/li&gt;
    &lt;li&gt;&lt;font size="2"&gt;&lt;u&gt;Set-Writeable&lt;/u&gt; - This just removes the Read-Only flag from files, but it would have come in handy last year when we had to upgrade several projects to the 2.0 framework and move them from VSS to TFS. Removing a project from VSS is painful and one of the more tedious steps is clearing the read-only flag on all the source files. I remember wasting an hour of my life writing and debugging a VBScript because the right-click/recursive method never seemed to fully work. &lt;/font&gt;&lt;/li&gt;
    &lt;li&gt;&lt;font size="2"&gt;&lt;u&gt;Out-Clipboard&lt;/u&gt; - One of the things that still sucks about working in the shell environment is the editing capabilities, especially when it comes to copy and pasting. When I want to transfer the results of a command to an email or word doc, I simply pipe it to this cmdlet. &lt;/font&gt;&lt;/li&gt;
    &lt;li&gt;&lt;font size="2"&gt;&lt;u&gt;Send-Smtp&lt;/u&gt; - This will be great for the error-handling notification part of scripts. It would be even better if I could figure out how to populate the body parameter from the pipeline. &lt;/font&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;font size="2"&gt;You can get a list of the 59 new cmdLets added when installing this snap-in by calling the function &lt;strong&gt;gcmpscx. &lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=114207"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=114207" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/coredump/aggbug/114207.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Russell Ball</dc:creator>
            <guid>http://geekswithblogs.net/coredump/archive/2007/07/26/114207.aspx</guid>
            <pubDate>Fri, 27 Jul 2007 04:38:01 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/coredump/comments/114207.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/coredump/archive/2007/07/26/114207.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/coredump/comments/commentRss/114207.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/coredump/services/trackbacks/114207.aspx</trackback:ping>
        </item>
        <item>
            <title>Using Powershell with SQL Server</title>
            <link>http://geekswithblogs.net/coredump/archive/2007/07/25/114162.aspx</link>
            <description>&lt;p&gt;&lt;font face="Arial"&gt;&lt;font size="2"&gt;Anything that can be done with ADO.NET is possible in PowerShell through a call to Assembly::Load and the New-Object cmdLet, but that doesn't mean that the resulting code will seem very shell-like or practical. Two approaches to database access that definitely do seem compelling to me, however, are the sample &lt;/font&gt;&lt;a href="http://blogs.msdn.com/powershell/archive/2007/06/21/demo-sql-provider-code.aspx"&gt;&lt;font size="2"&gt;SQL Provider&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt; recently demoed by the PowerShell team and Dan Sullivan's &lt;span lang="EN-US" style="font-size: 10pt;"&gt;&lt;span lang="EN-US" style="font-size: 10pt;"&gt;&lt;a href="http://www.simple-talk.com/sql/database-administration/powersmo-at-work-part-2/"&gt;PowerSMO&lt;/a&gt; script&lt;/span&gt;&lt;/span&gt;, which is really just a thin wrapper around the SQL Management Objects found in the Microsoft.SqlServer.Management.Smo namespace. The SQL Provider allows traditional command line navigation through the database using dir and cd and the SMO objects provide access to nearly any administrative function in SQL Server.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2" face="Arial"&gt;In order to use the PowerShell team's SQL Provider, you'll need to download &lt;a href="http://blogs.msdn.com/powershell/attachment/3436729.ashx"&gt;SQLProvider.dll&lt;/a&gt;, install it in the GAC, and call the Add-PSSnapin cmdLet. Then you can treat the database just like the filesystem and cd or dir your way around with statements such as the following:&lt;/font&gt;&lt;/p&gt;
&lt;font face="Arial"&gt;&lt;blockquote dir="ltr" style="margin-right: 0px;"&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;&lt;font size="2"&gt;PS&amp;gt;cd SQL:&lt;/font&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;&lt;font size="2"&gt;SQL:&amp;gt;cd MySQLServerName&lt;/font&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;&lt;font size="2"&gt;SQL:&amp;gt;dir&lt;/font&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;font size="2"&gt;master&lt;br /&gt;
tempdb&lt;br /&gt;
model&lt;br /&gt;
msdb&lt;br /&gt;
pubs&lt;br /&gt;
Northwind&lt;/font&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;&lt;font size="2"&gt;SQL:&amp;gt;cd Northwind&lt;/font&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;&lt;font size="2"&gt;SQL:&amp;gt;dir&lt;/font&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;font size="2"&gt;name&lt;br /&gt;
----&lt;br /&gt;
Categories&lt;br /&gt;
CustomerCustomerDemo&lt;br /&gt;
CustomerDemographics&lt;br /&gt;
.. etc...&lt;/font&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;&lt;font size="2"&gt;SQL:&amp;gt;cd Employees&lt;/font&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;&lt;font size="2"&gt;SQL:&amp;gt;Dir -filter {where EmployeeId=8}&lt;/font&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;font size="2"&gt;EmployeeID      : 8&lt;br /&gt;
LastName        : Callahan&lt;br /&gt;
...etc...&lt;/font&gt;&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;&lt;/font&gt;
&lt;p&gt;&lt;font size="2" face="Arial"&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2" face="Arial"&gt;Unfortunately, this provider is only a partially implemented sample and I quickly lost interest when I figured out that I couldn't easily or naturally pipe the results to the where, select, and sort cmdLets. I did some quick searching to see if someone else had taken the next step and fully implemented a sql provider but I didn't come across anything. However, I'm sure it won't be long before somebody creates a production-ready version. The PS team did include the code for their sample provider, so perhaps I'll take a look at it myself to see how hard it is. &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2" face="Arial"&gt;To run the PowerSMO examples found on Dan Sullivan's blog, you simply need to run a &lt;a href="http://www.pluralsight.com/dan/samples/InitPowerSMO.zip"&gt;powershell script&lt;/a&gt; or place it in your profile so that it is run automatically when you start the shell. The script preloads some required dll's and provides a factory function for retrieving some of the key objects, so retrieving a server object feels more like a cmdLet experience. &lt;/font&gt;&lt;/p&gt;
&lt;blockquote dir="ltr" style="margin-right: 0px; font-weight: bold; font-family: Arial; color: rgb(0, 0, 255);"&gt;
&lt;p&gt;&lt;font size="2"&gt;$server = get-SMO_Server mySQLServerName&lt;/font&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;font size="2" face="Arial"&gt;However, since he warns that his script is for instructional purposes only, you might also just want to load the server object directly: &lt;/font&gt;&lt;/p&gt;
&lt;blockquote dir="ltr" style="margin-right: 0px; color: rgb(0, 0, 255);"&gt;
&lt;p style="font-family: Arial; font-weight: bold;"&gt;&lt;font size="2"&gt;[System.Reflection.Assembly]::Load("Microsoft.SqlServer.Smo,Culture=Neutral,Version=9.0.242.0,PublicKeyToken=89845dcd8080cc91") | out-null&lt;/font&gt;&lt;/p&gt;
&lt;p style="font-family: Arial; font-weight: bold;"&gt;&lt;font size="2"&gt;$server = new-object "Microsoft.SqlServer.Management.Smo.Server" myServer&lt;/font&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;font size="2"&gt;&lt;span style="font-family: Arial;"&gt;Then you can grab a database object and do interesting things like finding which tables and indexes in your database are taking up the most space.&lt;/span&gt;&lt;/font&gt;&lt;span lang="EN-US" style="font-size: 10pt;"&gt;&lt;span lang="EN-US" style="font-size: 10pt;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span lang="EN-US" style="font-size: 10pt;"&gt;&lt;span lang="EN-US" style="font-size: 10pt;"&gt;&lt;font face="Arial"&gt;&lt;font face="Arial"&gt;&lt;font size="2" face="Arial"&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;blockquote dir="ltr" style="margin-right: 0px; font-family: Arial; font-weight: bold; color: rgb(0, 0, 255);"&gt;
&lt;p&gt;&lt;font size="2"&gt;$pubs = $s.databases | ?{$_.name -eq "pubs"}&lt;/font&gt;&lt;/p&gt;
&lt;/blockquote&gt;  &lt;blockquote dir="ltr" style="margin-right: 0px; font-family: Arial; font-weight: bold; color: rgb(0, 0, 255);"&gt;
&lt;p&gt;&lt;font size="2"&gt;$pubs.tables | ?{$_.name -notlike "sys*"} | select name, dataspaceused,indexspaceused,@{name="Total Space";expression={$_.dataspaceused + $_.indexspaceused}} | sort dataspaceused -desc&lt;/font&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p style="font-family: Arial;"&gt;&lt;font size="2"&gt;...or finding out the firve widest tables in the database as potential candidates for normalization and save it to an html file.&lt;/font&gt;&lt;/p&gt;
&lt;blockquote dir="ltr" style="margin-right: 0px;"&gt;
&lt;p&gt;&lt;font size="2" style="font-weight: bold; color: rgb(0, 0, 255);"&gt;&lt;span style="font-family: Arial;"&gt; $pubs.tables | ?{$_.name -notlike "sys*"} |select name, @{name="Columns";expression={$_.columns.count}} -first 5 | sort columns -desc | convertto-html &amp;gt; C:\wideTables.html&lt;/span&gt;&lt;/font&gt;&lt;span lang="EN-US" style="font-size: 10pt;"&gt;&lt;span lang="EN-US" style="font-size: 10pt;"&gt;&lt;font face="Arial"&gt;&lt;font face="Arial"&gt;&lt;strong&gt;&lt;em&gt;&lt;br /&gt;
&lt;/em&gt;&lt;/strong&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;font size="2"&gt;Again, you can do almost any of these functions through some other way (system sproc, sql function, utility), but what is significant is the capabilities that powerShell gives you to be able to manipulate the resulting data once you have it (sort, group, filter, format, etc.).&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=114162"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=114162" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/coredump/aggbug/114162.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Russell Ball</dc:creator>
            <guid>http://geekswithblogs.net/coredump/archive/2007/07/25/114162.aspx</guid>
            <pubDate>Wed, 25 Jul 2007 12:24:13 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/coredump/comments/114162.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/coredump/archive/2007/07/25/114162.aspx#feedback</comments>
            <slash:comments>2</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/coredump/comments/commentRss/114162.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/coredump/services/trackbacks/114162.aspx</trackback:ping>
        </item>
        <item>
            <title>Disk Space Management with Powershell</title>
            <link>http://geekswithblogs.net/coredump/archive/2007/07/20/114077.aspx</link>
            <description>&lt;p&gt;&lt;font face="Arial"&gt;&lt;font size="2"&gt;The more I work with powershell, the more I start seeing everything that lives on the computer as part of a giant database that I can query. When used in conjunction with the pipeline and &lt;strong&gt;get-member -type property&lt;/strong&gt; to discover the available properties on an object, the &lt;strong&gt;where-object, sort-object, select-object&lt;/strong&gt;, and &lt;strong&gt;group-object&lt;/strong&gt; cmdlets can be strung together to answer some very sophisticated questions. We often seem to run out of space on our development sql servers, so one tedious question that I am often forced to answer manually or with a utility such as &lt;/font&gt;&lt;a href="http://windirstat.info/"&gt;&lt;font size="2"&gt;windirstat&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt; is which sql backups are taking the most space so we can delete unused ones and free up space. This question can be answered easily and quickly in one line from powershell and then exported to text, csv, or html so that it can be sent to anyone else that needs to assist in the decision making process. In fact, with an extra line of code you could easily load up the .NET SMTPClient class in system.net.mail and email the output without leaving the command line. Here is the powershell one-liner that I used to find the largest 10 backups on a development server and save the output to a text file:&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2" face="Arial"&gt;&lt;em&gt;&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2" face="Arial"&gt;&lt;em&gt;&lt;strong&gt;Dir \\devsql\sqlbackups *.bak -rec | sort length -desc | select name,directory, @{name="Size in GB";Expression={[System.Math]::Round($_.length/1073741824,1)}},CreationTime -first 10 | ft -auto &amp;gt; C:\LargeBackups.txt&lt;/strong&gt;&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p style="margin-right: 0px;" dir="ltr"&gt;&lt;font face="Arial"&gt;&lt;font size="2" face="Arial"&gt;This produces output that looks something like this:&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p style="margin-right: 0px;" dir="ltr"&gt;&lt;font face="Arial"&gt;&lt;font size="2" face="Arial"&gt;Name                                      Directory                   Size-GB   CreationTime  &lt;br /&gt;
----                                           ---------                          --------       ------------  &lt;br /&gt;
LendingHistory.bak              \\devsql\sqlbackups\Dev03       7.5     0/27/2006&lt;br /&gt;
Lending0702.bak                 \\devsql\sqlbackups\Dev01       6.2     06/29/2007&lt;br /&gt;
LendingPostEOD0628.bak   \\devsql\sqlbackups\Dev01       6.2     06/29/2007&lt;br /&gt;
LendingSOD0628.bak          \\devsql\sqlbackups\Dev01      6.1      06/12/2007&lt;br /&gt;
LendingSOD0627.bak          \\devsql\sqlbackups\Dev01      6.1      06/29/2007&lt;br /&gt;
Lending.bak                        \\devsql\sqlbackups\Dev02      6.1      11/27/2006&lt;br /&gt;
Investments.bak                  \\devsql\sqlbackups\Dev02      6.1      05/23/2007&lt;br /&gt;
InvestmentsHistory.bak        \\devsql\sqlbackups\Dev02     6 1       1/27/2006&lt;br /&gt;
Warehouse.bak                   \\devsql\sqlbackups\Dev01     5.9        04/25/2007&lt;br /&gt;
Lending.bak                        \\devsql\sqlbackups\Dev01     5.9        10/27/2006&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=114077"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=114077" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/coredump/aggbug/114077.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Russell Ball</dc:creator>
            <guid>http://geekswithblogs.net/coredump/archive/2007/07/20/114077.aspx</guid>
            <pubDate>Fri, 20 Jul 2007 13:36:04 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/coredump/comments/114077.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/coredump/archive/2007/07/20/114077.aspx#feedback</comments>
            <slash:comments>2</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/coredump/comments/commentRss/114077.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/coredump/services/trackbacks/114077.aspx</trackback:ping>
        </item>
        <item>
            <title>How To Log On To A Web App With One Keystroke Using Powershell</title>
            <link>http://geekswithblogs.net/coredump/archive/2007/07/18/114027.aspx</link>
            <description>&lt;p&gt;&lt;font face="Arial"&gt;&lt;font face="Arial"&gt;&lt;font size="2"&gt;I'm doing some work now on an internal web application where I had to logon with an external test account before I could do anything. That got old fast, so I created a powershell script file to automatically launch IE, input the username and password, and click the submit button. I originally tried to do this with WatiN, which provides a much easier interface for controlling the browser than the COM object InternetExplorer.Application, but I couldn't get by the security exceptions explained in this Scott Hanselman &lt;/font&gt;&lt;a href="http://www.hanselman.com/blog/WATIRForNETWatiNApproaches08ReleaseAndAutomatingIEFromPowerShell.aspx"&gt;&lt;font size="2"&gt;post&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt;. I then added a keystroke shortcut in &lt;/font&gt;&lt;a href="http://www.freedownloadscenter.com/Utilities/Mouse_and_Keyboard_Utilities/WinKey_Download.html"&gt;&lt;font size="2"&gt;WinKey&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt; to execute this ps1 file via the &lt;/font&gt;&lt;a href="http://www.ntwind.com/software/utilities/hstart.html"&gt;&lt;font size="2"&gt;hstart&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt; utility so that no command window would flash on the screen before the browser window could load. It's probably not the cleanest solution, but it has been a huge time and annoyance saver.&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2" face="Arial"&gt;Here's the winkey info&lt;/font&gt;&lt;/p&gt;
&lt;blockquote dir="ltr" style="margin-right: 0px;"&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;em&gt;&lt;font size="2"&gt;&lt;strong&gt;command&lt;/strong&gt;: &lt;/font&gt;&lt;/em&gt;&lt;font face="Arial"&gt;&lt;em&gt;&lt;font size="2"&gt;&amp;lt;&amp;lt;local path&amp;gt;&amp;gt;\hstart.exe&lt;br /&gt;
&lt;strong&gt;parameters&lt;/strong&gt;: &lt;font face="Arial"&gt;/nowindow "C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe -command ""&amp;amp;"  'C:\myScriptsDirectory\launchWebApp.ps1'""&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;font size="2"&gt;...And the powershell script&lt;/font&gt;&lt;/p&gt;
&lt;blockquote dir="ltr" style="margin-right: 0px;"&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;font size="2" face="Arial"&gt;$psie = new-object -com InternetExplorer.Application&lt;br /&gt;
$psie.Navigate2("http://www.someWebApp/")&lt;br /&gt;
$psie.visible=1&lt;br /&gt;
($psie.document.getElementsByTagName("input") | where { $_.Name -eq "UserID"}).value = "userID"&lt;br /&gt;
($psie.document.getElementsByTagName("input") | where { $_.Name -eq "Password"}).value = "password"&lt;br /&gt;
($psie.Document.GetElementsByTagname("input") | where { $_.Value -eq "Login"}).click()&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;/blockquote&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=114027"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=114027" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/coredump/aggbug/114027.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Russell Ball</dc:creator>
            <guid>http://geekswithblogs.net/coredump/archive/2007/07/18/114027.aspx</guid>
            <pubDate>Wed, 18 Jul 2007 17:56:33 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/coredump/comments/114027.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/coredump/archive/2007/07/18/114027.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/coredump/comments/commentRss/114027.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/coredump/services/trackbacks/114027.aspx</trackback:ping>
        </item>
        <item>
            <title>A Powershell Inspired Prank</title>
            <link>http://geekswithblogs.net/coredump/archive/2007/07/13/113916.aspx</link>
            <description>&lt;p&gt;&lt;span style="font-size: 10pt; font-family: 'Arial','sans-serif';"&gt;Here is a good joke to play on one of your developer buddies if they have powershell and SQL Server installed on their local machines and you have sa rights on the SQL Server for whatever reason (former debugging help, open environment between developers, blank sa password, or mad hacker skills on your part). Wait until they are busy typing and execute the following query in Query Analyzer (or using sqlcmd.exe if you want to be a purist) against their SQL Server. You may want to lock down your own machine before trying this in order to avoid certain retribution...:-)&lt;/span&gt;&lt;/p&gt;
&lt;blockquote dir="ltr" style="margin-right: 0px;"&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 10pt;"&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="font-size: 10pt; color: gray; line-height: 115%; font-family: 'Arial','sans-serif';"&gt;master..&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="font-size: 10pt; color: maroon; line-height: 115%; font-family: 'Arial','sans-serif';"&gt;xp_cmdshell&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="font-size: 10pt; line-height: 115%; font-family: 'Arial','sans-serif';"&gt; "powershell.exe (new-object -com 'SAPI.spvoice').speak('Ouch. You are typing too hard')"&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;This is a little more difficult with SQL 2005 because remote connections and xp_cmdshell are both disabled by default for obvious security reasons. You can enable remote connections by adding exceptions to the windows firewall for SQLServer and SQL Browser as described in the following &lt;a href="http://support.microsoft.com/default.aspx?scid=kb;EN-US;914277"&gt;&lt;span style="font-size: 10pt;"&gt;KB article&lt;/span&gt;&lt;/a&gt;. &lt;/span&gt;&lt;span style="font-size: 10pt;"&gt;You can enable xp_cmdshell in SQL 2005 with the following script:&lt;/span&gt;&lt;/p&gt;
&lt;blockquote dir="ltr" style="margin-right: 0px;"&gt;
&lt;p&gt;&lt;font face="Times New Roman"&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;EXECUTE&lt;/span&gt;&lt;span style="font-size: 10pt; color: maroon;"&gt; sp_configure&lt;/span&gt;&lt;/font&gt;&lt;span style="font-size: 10pt;"&gt;&lt;font face="Times New Roman"&gt; &lt;span style="color: red;"&gt;'show advanced options'&lt;/span&gt;&lt;span style="color: gray;"&gt;,&lt;/span&gt; 1&lt;br /&gt;
&lt;span style="color: blue;"&gt;RECONFIGURE&lt;/span&gt; &lt;span style="color: blue;"&gt;WITH&lt;/span&gt; OVERRIDE&lt;br /&gt;
GO&lt;br /&gt;
&lt;span style="color: blue;"&gt;EXECUTE&lt;/span&gt; &lt;span style="color: maroon;"&gt;sp_configure&lt;/span&gt; &lt;span style="color: red;"&gt;'xp_cmdshell'&lt;/span&gt;&lt;span style="color: gray;"&gt;,&lt;/span&gt; &lt;/font&gt;&lt;font face="Times New Roman"&gt;&lt;span style="color: red;"&gt;'1'&lt;br /&gt;
&lt;/span&gt;&lt;span style="color: blue;"&gt;RECONFIGURE&lt;/span&gt; &lt;span style="color: blue;"&gt;WITH&lt;/span&gt; OVERRIDE&lt;br /&gt;
GO&lt;br /&gt;
&lt;span style="color: blue;"&gt;EXECUTE&lt;/span&gt; &lt;span style="color: maroon;"&gt;sp_configure&lt;/span&gt; &lt;span style="color: red;"&gt;'show advanced options'&lt;/span&gt;&lt;span style="color: gray;"&gt;,&lt;/span&gt; 0&lt;br /&gt;
&lt;span style="color: blue;"&gt;RECONFIGURE&lt;/span&gt; &lt;span style="color: blue;"&gt;WITH&lt;/span&gt; OVERRIDE&lt;br /&gt;
GO&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;If you're really itching to do this prank but they don't have Powershell or SQL Server installed, there are still lots of options. All you really need is a way to shell out a command against someone else's computer since the underlying voice capabilities come from a COM component, which you can call from vbs script. Have fun...&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=113916"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=113916" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/coredump/aggbug/113916.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Russell Ball</dc:creator>
            <guid>http://geekswithblogs.net/coredump/archive/2007/07/13/113916.aspx</guid>
            <pubDate>Fri, 13 Jul 2007 14:03:24 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/coredump/comments/113916.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/coredump/archive/2007/07/13/113916.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/coredump/comments/commentRss/113916.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/coredump/services/trackbacks/113916.aspx</trackback:ping>
        </item>
        <item>
            <title>Learning Powershell Without Leaving the Command Line</title>
            <link>http://geekswithblogs.net/coredump/archive/2007/07/10/113820.aspx</link>
            <description>&lt;p&gt;&lt;font size="2"&gt;I've been impressed by the attention paid to discoverabiltiy in powershell, which has allowed me to quite a bit of learning without ever leaving the command line. Here are a few of my favorite features:&lt;/font&gt;&lt;/p&gt;
&lt;blockquote style="margin-right: 0px;" dir="ltr"&gt;
&lt;p&gt;&lt;font size="2"&gt;&lt;u&gt;Guessing&lt;/u&gt; - This may seem strange to list as the number one discoverability feature, but I think the Powershell design team did an excellent job of exposing functionality through well scoped cmdLets that are logically and consistently named. With cmd.exe, the majority of the heavy lifting is done by executables with terse names that have become bloated with too many responsibilities so that you have to constantly rely on references to figure things out. In powershell, the verb-noun pattern is strictly enforced and the names are always consistent so that I can write &lt;strong&gt;Get-Command *service&lt;/strong&gt; and be assured that I will get all the cmdLets related to services and then figure out what they do through the verb part of their name.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;&lt;u&gt;Built-In Help&lt;/u&gt; - If you're not sure what a cmdLet does, then use the Get-Help cmdLet to see the documentation. DOS exes usually have a ? switch for help, but what really makes this powershell feature shine are the -full and -example switches that bring back detailed examples and additional notes about usage and each of the parameters. The powershell team also embedded plenty of conceptual help outside of cmdlets that follow the about_ pattern. You can see them through &lt;strong&gt;Get-Help about_*.&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;&lt;u&gt;Trusting Operations &lt;/u&gt;- Are you afraid to execute a script because you're not sure what it will do? Try the -whatif parameter that is ubiquitous to all commands. For example, &lt;strong&gt;del C:\f*.txt -whatif&lt;/strong&gt; will just tell you which files would have been deleted rather than actually deleting them.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;&lt;u&gt;Get-Member&lt;/u&gt; - I find this cmdLet most useful when I'm not sure what object I am getting back from the pipeline. I simply add &lt;strong&gt;| Get-member&lt;/strong&gt; to the end of the command and I can see what additional methods I have to work with or what properties I can perform filtering and sorting on.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;&lt;u&gt;Get-Alias&lt;/u&gt;- I love all the transitional and convenience aliases provided by powershell to maximize productivity for throw-away, administrative tasks, but sometimes it makes it hard to decipher examples that you see on the web. Calling &lt;strong&gt;Get-Alias gps&lt;/strong&gt; will return the full, logical name of the cmdLet and will usually allow you to figure out its function. Better yet, use this command with no parameters to return all the aliases so you can learn them and increase your own command line speed.&lt;/font&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p dir="ltr"&gt;&lt;font size="2"&gt;&lt;strong&gt;Other resources&lt;/strong&gt; - Despite all these great features, it would be silly to not also seek outside resources. Here are a few that I've found helpful&lt;/font&gt;&lt;/p&gt;
&lt;blockquote style="margin-right: 0px;" dir="ltr"&gt;
&lt;p&gt;&lt;font size="2"&gt;&lt;u&gt;WebCasts&lt;/u&gt; - I've made my way through 2 of the 5 &lt;/font&gt;&lt;a href="http://www.microsoft.com/technet/scriptcenter/webcasts/ps.mspx"&gt;&lt;font size="2"&gt;Powershell Week&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt; web casts. They are a little long (usually over an hour), but are full of good information and perfect for the visual learners.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;&lt;u&gt;Blogs&lt;/u&gt; - The best is probably the one put out by the &lt;/font&gt;&lt;a href="http://blogs.msdn.com/powershell/default.aspx"&gt;&lt;font size="2"&gt;Powershell Team.&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt; I also recommend &lt;/font&gt;&lt;a href="http://keithhill.spaces.live.com/"&gt;&lt;font size="2"&gt;Keith Hill&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt; and &lt;/font&gt;&lt;a href="http://thepowershellguy.com/blogs/posh/default.aspx"&gt;&lt;font size="2"&gt;The Powershell Guy&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt;.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;&lt;u&gt;PodCasts&lt;/u&gt; - I highly recommend the all 3 shows that &lt;/font&gt;&lt;a href="http://www.hanselminutes.com/archives.aspx"&gt;&lt;font size="2"&gt;Scott Hanselman&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt; did on the subject. The &lt;/font&gt;&lt;a href="http://powerscripting.wordpress.com/"&gt;&lt;font size="2"&gt;Powerscripting Podcast&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt; is a little too slow paced for my taste, but it could be good if you're brand new and want something to listen to while mowing the lawn. &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;&lt;u&gt;Tutorials&lt;/u&gt; - The &lt;/font&gt;&lt;a href="http://www.microsoft.com/technet/scriptcenter/topics/winpsh/manual/default.mspx"&gt;&lt;font size="2"&gt;Powershell Owner's Manual&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt; on the technet script center isn't bad, although the authors went a little overboard at times to make the writing more interesting than the average tech spec. &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;&lt;u&gt;Books&lt;/u&gt; - I agree with Chris Sells and Don Box that books are still the best way to &lt;/font&gt;&lt;a href="http://www.dotnetrocks.com/default.aspx?showNum=249"&gt;&lt;font size="2"&gt;grok the zen&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt; of a technology. I'm finishing up with an excellent book by the Powershell Developer Lead, Bruce Payette, called &lt;/font&gt;&lt;a href="http://www.amazon.com/Windows-PowerShell-Action-Bruce-Payette/dp/1932394907"&gt;&lt;font size="2"&gt;Powershell in Action&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt; that I would highly recommend.&lt;/font&gt;&lt;/p&gt;
&lt;/blockquote&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=113820"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=113820" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/coredump/aggbug/113820.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Russell Ball</dc:creator>
            <guid>http://geekswithblogs.net/coredump/archive/2007/07/10/113820.aspx</guid>
            <pubDate>Tue, 10 Jul 2007 12:48:16 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/coredump/comments/113820.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/coredump/archive/2007/07/10/113820.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/coredump/comments/commentRss/113820.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/coredump/services/trackbacks/113820.aspx</trackback:ping>
        </item>
    </channel>
</rss>