1. Use the -Verbose switch
First, try to use the -Verbose switch with the cmdlet that produces the error message, that might print out a verbose version of the error.
2. In the Interactive Shell
Use the $Error environmental variable with Select * to get a detailed error message
$Error | Select-Object *
3. In the Try - Catch block
If you use the Try_Catch_Finally block for error handling, add the following line to the Catch block to get the detailed error shown
... Catch { $PSItem | Select-Object * } ...
Community Questions