04 July 2013

Full error Exception details

If you need full error name for your catch cmdlet or any other reason the only way to obtain it is by piping  the $Error automatic varialbe to one of the Format cmdlet and use the -Force parameter.
The Exception property of the $Error variable will contain the information:

$Error[0] | Format-Table * -Force

Exception  : Microsoft.ActiveDirectory.Management.ADIdentityNotFoundException:  Cannot find an object with identity: 'kajdhlkasd' under: 'DC=home,DC=net'.

No comments:

Post a Comment