How to convert Powershell to C#

hello B picture hello B · Feb 25, 2016 · Viewed 9.9k times · Source

Is possible to convert PowerShell code .PS1 to C# code?

I'v been looking to it on google but I always find the contrary.

Reflector has the AddIn to convert DLL to PS Code, so I think it's possible..

Answer

Ali Laraaj picture Ali Laraaj · Dec 14, 2019

You can try this Visual studio code extension : PowerShell Pro Tools for VS Code https://ironmansoftware.com/powershell-pro-tools-for-visual-studio-code/

enter image description here

Convert between C# and PowerShell code to easily take snippets of either language and convert it to the other. Quickly create P\Invoke functions in PowerShell from C# snippets found on sites like Pinvoke.net.