Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ironmansoftware/code-conversion

Code conversion command line tool for PowerShell and C#
https://github.com/ironmansoftware/code-conversion

converter csharp powershell

Last synced: about 2 months ago
JSON representation

Code conversion command line tool for PowerShell and C#

Awesome Lists containing this project

README

        

# PowerShell to C# Code Conversion

Orginally a feature of [PowerShell Pro Tools](https://docs.poshtools.com), this module provides the ability to convert between C# and PowerShell. No license required.

# Installation

```powershell
Install-Module CodeConversion
```

# Usage

## Convert from C# to PowerShell

```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#

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