Open ghost opened 6 years ago
Hello,
https://github.com/profesorfalken/jPowerShell/wiki/New-3.0-version-of-PowerShell
The reponse method isError is not working as before. Instead of telling if the command was sucessful, now it will only return false in case the command did not work at all (timeout or unexpected error). If you want to know the result of the command you should use the new method isLastCommandInError
Best regards
Hi, I have similar issues: 1. The method isLastCommandInError does not return error when cmd-let is not recognized e.g. Write 'Set-NetFirewallRule : No MSFT_NetFirewallRule objects found with property but jPowershell returns no errors. 2. Another case. If there is syntax error, I got proper indication through the isLastCommandInError , but how to get error message to the string? Method getCommandOutput returns nothing in such a case.
I am trying to revert to snapshot which doesn't exist.
Set-VM -VM windows10 -Snapshot snapshotvm123 -Confirm:$false
In the above commandsnapshotvm123
doesn't exist, so I want to print on the console a failed message with the command error message on the console.Tried with response.isError but it says false
Error message while executing the command on PowerShell: