This page is retired and no longer updated. Project documentation and download links are moved to their new home: PowerShell PKI Module.

Get-ErrorMessage

Synopsis

Displays a human readable error message of Win32 and WinInet error codes

Syntax

Get-ErrorMessage [-ErrorCode] <Int32> [<CommonParameters>]

Description

Displays a human readable error message of Win32 and WinInet error codes. The command supports short and long error message notations. The commands support both, integer and hex (0x########) forms.

Parameters

-ErrorCode <Int32>

Specifies a Win32/WinInet error code. This parameter supports short and long error code notations.
Short notation: 5
Long notation as hex: 0x80070005
Long notation as integer: -2147024891

Required? True
Position? 0
Default value
Accept pipeline input? false
Accept wildcard characters? False

<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, InformationAction, InformationVariable,
WarningAction, WarningVariable, OutBuffer, PipelineVariable and OutVariable.
For more information, see about_CommonParameters (https://go.microsoft.com/fwlink/?LinkID=113216).

Inputs

System.Int32

Outputs

System.String

Notes

Author: Vadims Podans
Blog: https://www.sysadmins.lv

Examples

Example 1

PS C:\> Get-ErrorMessage 5

Displays a text associated with the Win32 error code 5 (Access denied) that is specified in a short notation.

Example 2

PS C:\> Get-ErrorMessage 0x80070005

Displays a text associated with the Win32 error code 0x8007005 (Access denied) that is specified as a hex.

Example 3

PS C:\> Get-ErrorMessage -2147024891

Displays a text associated with the Win32 error code -2147024891 (Access denied) that is specified as an integer.

Related links

Minimum PowerShell version support

  • PowerShell 3.0

Operating System Support

  • Windows Vista
  • Windows 7
  • Windows 8
  • Windows 8.1
  • Windows 10
  • Windows Server 2008 all editions
  • Windows Server 2008 R2 all editions
  • Windows Server 2012 all editions
  • Windows Server 2012 R2 all editions
  • Windows Server 2016 all editions

Share this article: