Skip to content

Instantly share code, notes, and snippets.

@rikwatson
Created February 25, 2015 08:43
Show Gist options
  • Save rikwatson/44c0d02ad58a92382620 to your computer and use it in GitHub Desktop.
Save rikwatson/44c0d02ad58a92382620 to your computer and use it in GitHub Desktop.
Use C# from PowerShell
$csharp = @"
public class TakeAway
{
public static int Minus(int a, int b)
{
return (a - b);
}
}
"@
Add-Type -TypeDefinition $csharp
[TakeAway]::Minus(10,7)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment