$ERRORVIEW="CATEGORYVIEW"I saw this option:
$ErrorView = "CategoryView"
Hmmm, new to me. Exactly what does that terse little command do. Lets break something and find out.1/0
Yeah, that worked.Attempted to divide by zero.
At line:1 char:3
+ 1/ <<<< 0
+ CategoryInfo : NotSpecified: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : RuntimeException
Now, lets change our $ErrorView to "CategoryView".$ErrorView = CategoryView
and blow up more stuff:1/0
Well, much less shrapnel: NotSpecified: (:) [], ParentContainsErrorRecordException
In essence, CategoryView strips out a lot of the extra details and simply returns the CategoryInfo of the ErrorRecord. If you start playing about with the Debug cmdlets you will see this in a lot of output. Now you can know what its looking for.Ok, nothing revolutionary here, but, good to know about. To reset it to the default simply $nullilfy the variable:
$ErrorView = $null
0 comments:
Post a Comment