Like all PowerShell control structures, try/catch will execute in the
current scope:
PS (MTA) (1) >
$x=13; try { $x++ } finally { $x++ }; $x
15
Note: if you want to create a nested scope, you can always do
& { ... }
This works anywhere...
-bruce
--
Bruce Payette [MSFT]
Principal Developer, Windows PowerShell
Microsoft Corporation
This posting is provided "AS IS" with no warranties, and confers no rights.
Visit the Windows PowerShell Team blog at:
http://blogs.msdn.com/PowerShell
Visit the Windows PowerShell ScriptCenter at:
http://www.microsoft.com/technet/scr.../hubs/msh.mspx
My Book:
http://manning.com/powershell
"Roman Kuzmin" <z@xxxxxx> wrote in message
news:16CCC3E9-52AD-4F40-B550-46AC97B4B905@xxxxxx