Quantcast
Channel: Hello World – Laurent Schneider
Viewing all articles
Browse latest Browse all 4

[Hello World] run c# from powershell

$
0
0

How to run csharp code from command line with powershell. One line


PS> add-type 'public class c{public const string s="hello world";}';[c]::s
hello world

You can also execute visual basic directly from powershell.


PS> Add-Type -language visualbasic 'public class v
>> public const s as string = "Hello World"
>> end class'
>>
PS> [v]::s
Hello World

and also jscript


PS> add-type -language jscript -name j -memberdefinition 'class x{public const s="hello world";}'
PS> [j]::s
hello world

Viewing all articles
Browse latest Browse all 4

Latest Images

Trending Articles





Latest Images