Created
May 10, 2018 10:01
-
-
Save gislig/073ea54ffbbc8371ebd09bd1882ab8c9 to your computer and use it in GitHub Desktop.
This file contains 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
#The C# Code starts with @ sign and ends with @ sign. | |
$CSharpCode = @" | |
public class ExampleCSharp | |
{ | |
public string ReturnTheString(string returnString) | |
{ | |
string Combine = "Your awesome text is : " + returnString; | |
return Combine; | |
} | |
} | |
"@ | |
#Add the C# code as definition | |
Add-Type -TypeDefinition $CSharpCode | |
#Example is the public class | |
$ExampleCSharpCode = New-Object -TypeName ExampleCSharp | |
#Run the public string ReturnString to get the results | |
$ExampleCSharpCode.ReturnTheString("Hello World") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment