Created
October 15, 2015 21:53
-
-
Save vors/72198005bc57ec8faa4c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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