Skip to content

Instantly share code, notes, and snippets.

@thethomaseffect
Created October 11, 2013 12:26
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 thethomaseffect/6933803 to your computer and use it in GitHub Desktop.
Save thethomaseffect/6933803 to your computer and use it in GitHub Desktop.
C# in Powershell Scripts
$Source = @"
namespace CSharpPSTest
{
public static class PSTest
{
private static string _result = "Default Value";
public static string Get()
{
return "Get Success: " + _result;
}
public static string Set(string s)
{
_result = s;
return "Set Success: " + _result;
}
}
}
"@
Add-Type -TypeDefinition $Source -Language CSharp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment