我使用jPowerShell在Java中执行powershell,但是当我executeCommand()
这是我的代码:
PowerShellResponse response = powerShell.executeCommand(getAll);
//Print results
System.out.println("result :" + response.getCommandOutput());
executeCommand()
中的使用:
Future<String> result = threadpool.submit(commandProcessor);
commandOutput = result.get();
我不知道如何对结果进行编码。
答案 0 :(得分:0)
也许这会有所帮助?
Future<String> result = threadpool.submit(commandProcessor);
while (!result.isDone()) {}
String commandOutput = result.get();