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 use -ExecutionPolicy RemoteSigned in the command.
String cmd = "cmd /c powershell -ExecutionPolicy RemoteSigned -noprofile -noninteractive C:\Users\File.ps1