本文告诉大家如何在 dotnet core 通过 Host PowerShell 的方法使用 PowerShell 脚本
本文提供的方法需要在 dotnet core 2.1 和以上的版本,对于 dotnet core 2.1 以下暂时只能通过命令行调用 PowerShell.exe 的方法调用
在使用之前请创建一个 dotnet core 程序然后安装下面几个 Nuget 库
通过 System.Management.Automation.PowerShell 可以快速使用 PowerShell 脚本
使用 PowerShell.Create() 创建一个 PowerShell 类,在 PowerShell 类先添加脚本,然后就可以运行,运行函数会返回运行的返回的内容
public static void</

最低0.47元/天 解锁文章
1741

被折叠的 条评论
为什么被折叠?



