View Single Post
Old 07-18-2007   #1 (permalink)
A. Petitjean


 
 

PSH Guru needed ! : Trapping terminating errors

When I try this
trap { "Got it : division by zero !" } 1/$null; "next"

The trap is working successfully :
Got it : division by zero !
Tentative de division par zéro.
Au niveau de ligne : 1 Caractère : 44
+ trap { "Got it : division by zero !" } 1/$ <<<< null; "next"

But when I try this (who's the same thing in theory) :
trap { "Got it : division by zero !" } 1/0; "next"

I got :
Tentative de division par zéro.
Au niveau de ligne : 1 Caractère : 44
+ trap { "Got it : division by zero !" } 1/0 <<<< ; "next"

And my trap is not working !!!

What's wrong !? I have a big headhache with that problem ! Please help me !

Arnaud Petitjean
http://www.powershell-scripting.com
The PowerShell's French Community
My System SpecsSystem Spec