Skip to content

Instantly share code, notes, and snippets.

@adamdriscoll
Last active February 11, 2017 04:51
Show Gist options
  • Save adamdriscoll/a80e6cead071f1466537ba0b6e1fa8bb to your computer and use it in GitHub Desktop.
Save adamdriscoll/a80e6cead071f1466537ba0b6e1fa8bb to your computer and use it in GitHub Desktop.
Converts C# to PowerShell
Invoke-RestMethod -Uri https://codeconverter.net/csharp/powershell -Method Post -Body @{
Content="class MyClass { void Delete() { var item = new Object(); } }"
}
@dfinke
Copy link

dfinke commented Feb 10, 2017

$Content=@"
class MyClass { 
    string Greetings() 
    { 
        var s = "Hello from codeconverter.net/csharp/powershell `$(Get-Date)";
        s;
    } 
}
"@

Invoke-RestMethod https://codeconverter.net/csharp/powershell -Method Post -Body @{
    Content=$Content
} | % content  | iex

Greetings

@adamdriscoll
Copy link
Author

Awesome. FYI. I updated the URL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment