Sometimes, some local commands, such as Net.exe, return an error message in the form of a number in the course of execution. It's depressing that we don't know what these numbers mean. Previously, we could use the following methods to get the information that the numbers represent:
Copy Code code as follows:
ps> NET helpmsg 3534
The service did not a error.
ps> NET HELPMSG 1
Incorrect function.
ps> NET helpmsg 4323
The transport cannot access the medium.
In fact, there is a better way, that is, using winrm.exe, it can not only achieve the above functions, but also more powerful! Again, look at the translations of the top three errors:
Copy Code code as follows:
ps> WinRM helpmsg 3534
The service did not a error.
ps> WinRM helpmsg 1
Incorrect function.
ps> WinRM helpmsg 4323
The transport cannot access the medium.
OK, see, the result is the same. In fact, Net.exe can only translate the error message within a particular specification (specifically how a particular specification, Hongo is not very clear), and Winrm.exe is more powerful, such as it can convert "specific remote" error codes:
Copy Code code as follows:
ps> WinRM helpmsg 0x80338104
The Ws-management service cannot process the request. The WMI service returned an ' access Denied ' error.
ps> NET helpmsg 0x80338104
The syntax of this command is:
NET helpmsg
message#
As can be seen above, winrm.exe correct translation of the 0X80338104 error message, and Net.exe did not do so. In fact, this command may not be directly related to PowerShell, but it is a shell command, we can use it to translate any low-level API error code, and firmly believe that the results of it.