如何使用Kotlin运行Powershell脚本?
我试着移植了一些我在StackOverflow上找到的Java代码,但是我没能使它工作。我也尝试了以下方法:
Runtime.getRuntime().exec("powershell.exe [path to file]")
但是那也不起作用。
在Kotlin中,最简单的方法是什么?
如何使用Kotlin运行Powershell脚本?
我试着移植了一些我在StackOverflow上找到的Java代码,但是我没能使它工作。我也尝试了以下方法:
Runtime.getRuntime().exec("powershell.exe [path to file]")
但是那也不起作用。
在Kotlin中,最简单的方法是什么?
Runtime.getRuntime().exec("powershell.exe -File d:\\my-script.ps1")