Skip to content

Instantly share code, notes, and snippets.

@vors
Created October 15, 2015 21:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vors/72198005bc57ec8faa4c to your computer and use it in GitHub Desktop.
Save vors/72198005bc57ec8faa4c to your computer and use it in GitHub Desktop.
add-type @'
namespace foo {
public class bar {
public static void foo() { throw new System.Exception("Hello from C#"); }
}
}
'@
try { [foo.bar]::foo() } catch {$_.Exception.InnerException} # output 'Hello from C#'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment