如何将 Powershell 转换为 C#

hel*_*o B 5 .net c# dll powershell ps1

是否可以将 PowerShell 代码 .PS1 转换为 C# 代码?

我一直在谷歌上寻找它,但我总是发现相反。

ReflectorAddIn 将 DLL 转换为 PS Code,所以我认为这是可能的..

Ali*_*aaj 3

您可以尝试这个 Visual Studio 代码扩展:PowerShell Pro Tools for VS Code https://ironmansoftware.com/powershell-pro-tools-for-visual-studio-code/

在此输入图像描述

在 C# 和 PowerShell 代码之间进行转换,轻松获取任一语言的片段并将其转换为另一种语言。从 Pinvoke.net 等网站上找到的 C# 代码片段在 PowerShell 中快速创建 P\Invoke 函数。

  • 该操作要求从 PS 转换为 C#,而不是从 C# 转换为 PS (6认同)