Orginally a feature of PowerShell Pro Tools, this module provides the ability to convert between C# and PowerShell. No license required.
Install-Module CodeConversion
Invoke-CodeConversion -CSharp 'class MyClass {
public object MyMethod()
{
return new Object();
}
}'
<#
Outputs:
function MyMethod
{
return (New-Object -TypeName Object)
}
#>
Invoke-CodeConversion -PowerShell 'Get-Process'
# Outputs: System.Diagnostics.Process.GetProcesses()