this errorhandling drives me nuts, can't figure this one out :
as well continue,break as return do not work :
how do I trap this the right way, started with &{} also did not bring me the
wanted results :
function test {
"start"
if ($true){
trap {"Connecting to : foo Failed";return}
$Script:NameSpaces = new-object
System.Management.ManagementClass("\\foo\root") -ea stop
"do not run on error"
}
"run Always"
}
What I want to see is this :
Start
Connecting to : foo Failed
Run Always
plz help I'm getting nuts here
Greetings /\/\o\/\/


