Thursday, October 21, 2010

Display System Error Description in Powershell

In a powershell script, I need to see description system errors and constant value

I find the solution on Ward Horsfall site

# Decode a Win32 Error Code. Example below x5A8.

$err_msg = (new-object System.ComponentModel.Win32Exception(0x5A8));
Scroll bar range cannot be greater than MAXLONG

For information, you can find list of System Error Codes at
here some informations about FormatMessage

No comments: