I have a PowerShell Command which I need to execute using Java program. Can somebody guide me how to do this?
PowerShell Command
Java
My command is Get-ItemP
Get-ItemP
you can try to calle the powershell.exe with some commands like :
String[] commandList = {"powershell.exe", "-Command", "dir"}; ProcessBuilder pb = new ProcessBuilder(commandList); Process p = pb.start();