jPowerShell
jPowerShell copied to clipboard
simple executeSingleCommand need 6s
#6s PowerShellResponse powerShellResponse = PowerShell .executeSingleCommand("Get-CimInstance -ClassName Win32_Printer -Property Name|Select-Object -Property Name;"); #1s Process exec = Runtime.getRuntime() .exec("powershell.exe Get-CimInstance -ClassName Win32_Printer -Property Name|Select-Object -Property Name;"); #1s powershell> ....
i try some commands,all need 6s. There seems to be a configuration error it spend 5s. i dont know what happen
Trace it down in jPowerShell (debugger) - I could imagine that you've got a problem here. At least it was for me on unix.
In Java 9+, one can get the process PID in a better way.