<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"><channel><title>Huddled Masses - Latest Comments in Trap [Exception] { &amp;#8220;In PowerShell&amp;#8221; }</title><link>http://huddledmasses.disqus.com/</link><description>Joel Bennett's development blog...</description><language>en</language><lastBuildDate>Thu, 17 Jan 2008 06:52:39 -0000</lastBuildDate><item><title>Re: Trap [Exception] { &amp;#8220;In PowerShell&amp;#8221; }</title><link>http://HuddledMasses.org/trap-exception-in-powershell/#comment-2587399</link><description>You qualified the Try-Finally-Catch "as long as youâ€™re able to handle all of your exceptions in a single trap".&lt;br&gt;&lt;br&gt;Actually, you can nest the Try-Finally-Catch blocks effectively.  &lt;br&gt;&lt;br&gt;There are a couple of side effects I've learned and I'll blog it in the near future.  In short, whenever you use a scriptblock, you effectively creates a scope for variables.  As a result, varibales created or changed in a Try Section are unavailable in the Finaly or Catch scriptblocks.  This is not a big deal but it might need to be anticipated.  Also, this is not a specific effect from Try-Finally-Catch.  It happens with all scriptblocks.  This is usually managed by "dotting" the script.  I just haven't found a way to work it into the Try-Finally-Catch commandlet.&lt;br&gt;&lt;br&gt;Cash Foley</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Cash Foley</dc:creator><pubDate>Thu, 17 Jan 2008 06:52:39 -0000</pubDate></item><item><title>Re: Trap [Exception] { &amp;#8220;In PowerShell&amp;#8221; }</title><link>http://HuddledMasses.org/trap-exception-in-powershell/#comment-2587400</link><description>I made some comentary on a Try... Catch... Finally... function at &lt;br&gt;&lt;br&gt;&lt;a href="http://cashfoley.com/2007/10/13/TryFinallyCatchInPowershell10.aspx" rel="nofollow"&gt;http://cashfoley.com/2007/10/13/TryFinallyCatch...&lt;/a&gt;&lt;br&gt;&lt;br&gt;The origian post is by Adam Weigert  at &lt;a href="http://weblogs.asp.net/adweigert/archive/2007/10/10/powershell-try-catch-finally-comes-to-life.aspx" rel="nofollow"&gt;http://weblogs.asp.net/adweigert/archive/2007/1...&lt;/a&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">cash foley</dc:creator><pubDate>Sun, 14 Oct 2007 01:00:18 -0000</pubDate></item></channel></rss>