<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Documenting TRAP and THROW</title><link>http://blogs.msdn.com/powershell/archive/2006/12/29/documenting-trap-and-throw.aspx</link><description>We pride ourselves about being a bit overboard when it comes to Error handling. That is why our sparse (non-existing?) documentation of THROW and TRAP handling is both ironic and sad. 10,000 apologizes for that, we'll fix it in the next release. In the</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: Documenting TRAP and THROW</title><link>http://blogs.msdn.com/powershell/archive/2006/12/29/documenting-trap-and-throw.aspx#2265367</link><pubDate>Wed, 25 Apr 2007 01:37:54 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2265367</guid><dc:creator>jeremypack</dc:creator><description>&lt;p&gt;Nice but Don and Jeffery could not work out the syntax for:&lt;/p&gt;
&lt;p&gt;Trap [ExceptionType] {&lt;/p&gt;
&lt;p&gt;either it would seem as they don't have an example of how to express [ExceptionType]&lt;/p&gt;
&lt;p&gt;nor does Bruce Payette&lt;/p&gt;
&lt;p&gt;Sorry, but if they can't work it out how can I?&lt;/p&gt;
&lt;p&gt;:J&lt;/p&gt;</description></item><item><title>re: Documenting TRAP and THROW</title><link>http://blogs.msdn.com/powershell/archive/2006/12/29/documenting-trap-and-throw.aspx#2278287</link><pubDate>Thu, 26 Apr 2007 04:56:59 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2278287</guid><dc:creator>Jssmith</dc:creator><description>&lt;p&gt;Umm.&lt;/p&gt;
&lt;p&gt;Try this in a script file:&lt;/p&gt;
&lt;p&gt;trap [System.DivideByZeroException] { write-host (&amp;quot;trapped &amp;quot; + $_.Exception.GetType().Name); continue; }&lt;/p&gt;
&lt;p&gt;(1/$null)&lt;/p&gt;
&lt;p&gt;It works just fine&lt;/p&gt;</description></item><item><title>Debugging Powershell</title><link>http://blogs.msdn.com/powershell/archive/2006/12/29/documenting-trap-and-throw.aspx#3503163</link><pubDate>Sun, 24 Jun 2007 21:58:21 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3503163</guid><dc:creator>kapslock</dc:creator><description>&lt;p&gt;So why do you care about debugging powershell scripts? Umm unless you have the superhuman ability to&lt;/p&gt;
</description></item><item><title>re: Documenting TRAP and THROW</title><link>http://blogs.msdn.com/powershell/archive/2006/12/29/documenting-trap-and-throw.aspx#4629470</link><pubDate>Wed, 29 Aug 2007 16:42:10 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4629470</guid><dc:creator>scott zimmerman</dc:creator><description>&lt;p&gt;Fyi, the sample chapters at Sapien are chapter 1 and 9 (formatting) NOT chapter 11 (trap and throw).&lt;/p&gt;</description></item><item><title>re: Documenting TRAP and THROW</title><link>http://blogs.msdn.com/powershell/archive/2006/12/29/documenting-trap-and-throw.aspx#4813107</link><pubDate>Fri, 07 Sep 2007 21:04:48 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4813107</guid><dc:creator>Joel "Jaykul" Bennett</dc:creator><description>&lt;p&gt;I have to say it: LAME!&lt;/p&gt;
&lt;p&gt;It's almost like you guys went out of your way to make sure that all the PowerShell developers and their buddies could make some extra money writing books to fill the voids in your documentation.&lt;/p&gt;
&lt;p&gt;What's worse is that this is the first Google hit for powershell trap ... is there anywhere where there is *actual* document about it, instead of a broken link?&lt;/p&gt;</description></item><item><title>re: Documenting TRAP and THROW</title><link>http://blogs.msdn.com/powershell/archive/2006/12/29/documenting-trap-and-throw.aspx#4813113</link><pubDate>Fri, 07 Sep 2007 21:05:43 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4813113</guid><dc:creator>Joel "Jaykul" Bennett</dc:creator><description>&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://64.233.169.104/search?q=cache:vo1cixTB8RIJ:www.sapienpress.com/powershell.pdf"&gt;http://64.233.169.104/search?q=cache:vo1cixTB8RIJ:www.sapienpress.com/powershell.pdf&lt;/a&gt;&lt;/p&gt;</description></item><item><title>re: Documenting TRAP and THROW</title><link>http://blogs.msdn.com/powershell/archive/2006/12/29/documenting-trap-and-throw.aspx#4874492</link><pubDate>Wed, 12 Sep 2007 06:18:02 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4874492</guid><dc:creator>jbowles</dc:creator><description>&lt;p&gt;The book excerpt says &amp;quot;Trap handlers always execute, no matter what ErrorAction you specify&amp;quot; &amp;nbsp;&lt;/p&gt;
&lt;p&gt;It seems some commands require -ea 'stop' on the command or set globally with $ErrorActionPreference = &amp;quot;Stop&amp;quot; &lt;/p&gt;</description></item><item><title>re: Documenting TRAP and THROW</title><link>http://blogs.msdn.com/powershell/archive/2006/12/29/documenting-trap-and-throw.aspx#5447400</link><pubDate>Sun, 14 Oct 2007 05:23:14 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5447400</guid><dc:creator>Joel "Jaykul" Bennett</dc:creator><description>&lt;p&gt;How's this for an attempt?&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://huddledmasses.org/trap-exception-in-powershell/"&gt;http://huddledmasses.org/trap-exception-in-powershell/&lt;/a&gt;&lt;/p&gt;</description></item><item><title>re: Documenting TRAP and THROW</title><link>http://blogs.msdn.com/powershell/archive/2006/12/29/documenting-trap-and-throw.aspx#9406490</link><pubDate>Sun, 08 Feb 2009 08:58:45 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9406490</guid><dc:creator>Dave</dc:creator><description>&lt;p&gt;The link to &lt;a rel="nofollow" target="_new" href="http://www.sapienpress.com/powershell.pdf"&gt;http://www.sapienpress.com/powershell.pdf&lt;/a&gt; is busted&lt;/p&gt;</description></item><item><title>re: Documenting TRAP and THROW</title><link>http://blogs.msdn.com/powershell/archive/2006/12/29/documenting-trap-and-throw.aspx#9487285</link><pubDate>Wed, 18 Mar 2009 19:47:27 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9487285</guid><dc:creator>zi makki</dc:creator><description>&lt;p&gt;The link to the pdf is not working :( Any one have another link I can try?&lt;/p&gt;
&lt;p&gt;Cheers for all the hard work!&lt;/p&gt;
&lt;p&gt;Zi&lt;/p&gt;</description></item><item><title>Trap [Exception] { “In PowerShell” }</title><link>http://blogs.msdn.com/powershell/archive/2006/12/29/documenting-trap-and-throw.aspx#9514596</link><pubDate>Fri, 27 Mar 2009 19:58:07 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9514596</guid><dc:creator>It's my life... And I live it...</dc:creator><description>&lt;p&gt;This is a great example of how to use Trap and Throw in PowerShell to handle errors besides using SilentlyContinue&lt;/p&gt;
</description></item><item><title>re: Documenting TRAP and THROW</title><link>http://blogs.msdn.com/powershell/archive/2006/12/29/documenting-trap-and-throw.aspx#9626677</link><pubDate>Tue, 19 May 2009 05:23:57 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9626677</guid><dc:creator>NewPowerSUser</dc:creator><description>&lt;p&gt;Joel &amp;quot;Jaykul&amp;quot; Bennett, that last link to &lt;a rel="nofollow" target="_new" href="http://huddledmasses.org/trap-exception-in-powershell/"&gt;http://huddledmasses.org/trap-exception-in-powershell/&lt;/a&gt; was just perfect. &amp;nbsp;Thanks a ton.&lt;/p&gt;</description></item></channel></rss>