code-conversion icon indicating copy to clipboard operation
code-conversion copied to clipboard

Code conversion command line tool for PowerShell and C#

Results 9 code-conversion issues
Sort by recently updated
recently updated
newest added

Hello, I am trying to convert a ~100 line C# snippet to Powershell so that I don't have to use Add-Type to call the code however CodeConversion is erroring out....

I started a fresh Sandbox and followed your instructions: ``` PS C:\Users\WDAGUtilityAccount> Install-Module CodeConversion NuGet provider is required to continue PowerShellGet requires NuGet provider version '2.8.5.201' or newer to interact...

Even though the prompt is at my home folder, it forces the working path to be c:\windows\system32. ``` pwsh PS C:\Users\Andrew.Stanton> ConvertTo-Powershell -CSharpFile .\source\repos\MochaResultTestRailUploader\MochaResultTestRailUploader\MochaTypes.cs ConvertTo-PowerShell: File C:\WINDOWS\system32\source\repos\MochaResultTestRailUploader\MochaResultTestRailUploader\MochaTypes.cs not found. ```...

- Renamed Option value name to be consistent for OutputFile - Removed Required Option for PowerShell and CSharp

**input** `Invoke-CodeConversion -CSharp 'namespace HelloWorld{class Hello { static void Main(string[] args){System.Console.WriteLine("Hello World!");}}}'` **output** ```function Main { param([string[]]$args) $System.Console.WriteLine($Hello) }

Is it supposed to work on macOS? It outputs nothing: ```bash $pwsh PowerShell 7.2.4 Copyright (c) Microsoft Corporation. https://aka.ms/powershell Type 'help' to get help. PS /Users/a> Install-Module CodeConversion Untrusted repository...

Directly invoking the executable, since the script passes the wrong parameters as mentioned in #12, still doesn't work, throwing a FileNotFoundException for the output file: ```pwsh CodeConversion.exe -i .\MyModule.psm1 -o...

```pwsh Invoke-CodeConversion -InputFile .\MyModule.psm1 -OutputFile MyModule.cs ``` The parameters the executable expects do not match. The executable is expecting either `-o` or `--OutputPath`, but the script is explicitly sending `--OutputFile`....

Doesn't seem to work for converting to PowerShell. It can convert methods but does not handle classes with properties.