Open madhav-bharadwaj opened 5 years ago
Most commonly this is a timeout for multiple reasons. Check response.isTimeout() Check any of your calls directly first using the Powershell console. Yes, I agree, one could improve the logging in jPowerShell in order to see a history of command/timeouts/errors and so forth. The timeout stuff is as far as I know not logged. Additionally we could provide slf4j thoroughly in all sources
I have the below code which executes a powershell command and prints the output. I want the output to be printed to the logs so that the user knows if in case there is an error in command execution.
PowerShellResponse response = powerShell.executeCommand("$Session = New-PSSession -ComputerName "+hostname+" -Credential $cred"); System.out.println("response---"+response.getCommandOutput());
When I try to print the output when the session command is not successfull, it prints blank. Not sure what i'm doing wrong here. Can you please help.