Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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#
- Host: GitHub
- URL: https://github.com/ironmansoftware/code-conversion
- Owner: ironmansoftware
- License: apache-2.0
- Created: 2022-03-30T18:00:32.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-11-10T05:04:52.000Z (11 months ago)
- Last Synced: 2024-05-29T02:33:38.019Z (4 months ago)
- Topics: converter, csharp, powershell
- Language: C#
- Homepage:
- Size: 69.3 KB
- Stars: 116
- Watchers: 7
- Forks: 19
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - ironmansoftware/code-conversion - Code conversion command line tool for PowerShell and C# (C# #)
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()
```