相关疑难解决方法(0)

从.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/

在Visual Studio中引用system.management.automation.dll

https://www.nuget.org/packages/System.Management.Automation/

.net c# powershell .net-core asp.net-core

22
推荐指数
3
解决办法
2万
查看次数

标签 统计

.net ×1

.net-core ×1

asp.net-core ×1

c# ×1

powershell ×1