Skip to content

Instantly share code, notes, and snippets.

@vmwarecode
Created May 5, 2016 06:58
Show Gist options
  • Select an option

  • Save vmwarecode/47ab44da9514fb746e05d6e3e12086dc to your computer and use it in GitHub Desktop.

Select an option

Save vmwarecode/47ab44da9514fb746e05d6e3e12086dc to your computer and use it in GitHub Desktop.
PowerShell error resolution
function Resolve-Error ($ErrorRecord=$Error[0])
{
$ErrorRecord | Format-List * -Force
$ErrorRecord.InvocationInfo |Format-List *
$Exception = $ErrorRecord.Exception
for ($i = 0; $Exception; $i++, ($Exception = $Exception.InnerException))
{ “$i” * 80
$Exception |Format-List * -Force
}
}
Set-Alias rver Resolve-Error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment