有沒有辦法從.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怎麼樣? –