有没有办法从.net-core运行PowerShell脚本?从.NET Core运行PowerShell
我想在一个新的.net核心'website \ api'中运行一个PowerShell脚本。 从我可以告诉为了在.net上运行PowerShell我们需要添加
System.Management.Automation命名空间。
这是不可能的.net核心(或我还没有找到适当的方式来添加它)。 有几个NuGet包也是为了将这个DLL添加到项目中,但它们与.net内核不兼容。 有没有办法在.net核心上做到这一点? 这里有一些链接我做过尝试,但他们都不是.NET的核心具体:
http://www.powershellmagazine.com/2014/03/18/writing-a-powershell-module-in-c-part-1-the-basics/
Referencing system.management.automation.dll in Visual Studio
https://www.nuget.org/packages/System.Management.Automation/
hun,tek首先链接是2014 –
第一个链接是显示通过代码运行shell所需的代码(和命名空间).... – JanivZ
net-core怎么样? –