-
Notifications
You must be signed in to change notification settings - Fork 725
/
Copy pathGet-HelpMessage.ps1
46 lines (37 loc) · 1.24 KB
/
Get-HelpMessage.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
function Get-HelpMessage {
<#
.SYNOPSIS
Function to explain why an error occurred and provides problem-solving information.
Equivalent of NET HELPMSG
.DESCRIPTION
Function to explain why an error occurred and provides problem-solving information.
Equivalent of NET HELPMSG.
The function also create an alias called HelpMsg, so you can call the function this way:
HelpMsg 618
.PARAMETER Id
Specify the ID of the error you want to retrieve.
Can be decimal, hexadecimal
.EXAMPLE
Get-HelpMessage 618
The specified compression format is unsupported
.EXAMPLE
Get-HelpMessage 0x80070652
Another installation is already in progress. Complete that installation before proceeding with this install
.EXAMPLE
Get-HelpMessage –2147023278
Another installation is already in progress. Complete that installation before proceeding with this install
.NOTES
http://www.leeholmes.com/blog/2009/09/15/powershell-equivalent-of-net-helpmsg/
.LINK
https://github.com/lazywinadmin/PowerShell
#>
[CmdletBinding()]
[Alias('HelpMsg')]
PARAM($Id)
try {
[ComponentModel.Win32Exception] $id
}
catch {
$PSCmdlet.ThrowTerminatingError($_)
}
}