Skip to content

ironmansoftware/code-conversion

Repository files navigation

PowerShell to C# Code Conversion

Orginally a feature of PowerShell Pro Tools, this module provides the ability to convert between C# and PowerShell. No license required.

Installation

Install-Module CodeConversion

Usage

Convert from C# to PowerShell

Invoke-CodeConversion -CSharp 'class MyClass { 
    public object MyMethod()
    {
        return new Object();
    }
}'
<#
Outputs: 

function MyMethod
{
        return (New-Object -TypeName Object)
}

#>

Convert from PowerShell to C#

Invoke-CodeConversion -PowerShell 'Get-Process'
# Outputs: System.Diagnostics.Process.GetProcesses()

About

Code conversion command line tool for PowerShell and C#

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published