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