-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
powershell_script returns 0 for scripts with syntax errors #2247
Comments
/cc: @adamedx |
Fixed this by calling out to Powershell 2 times per script call in a private gem. Not the best implementation but works.
|
That's not unreasonable @carpnick -- we could probably just include the block twice in the script in the provider to see if that triggers errors for non-wellformed methods. |
The fix has been merged in #3080 |
I submitted this PR: #2244 but it only adds a test showing the problem.
The following:
Will indicate that "fail" ran successfully. It did not, powershell reported a parse error. Basically if you make a syntax error in your powershell script the only evidence of failure will be that whatever it was supposed to do will not be done.
I understand there are two needs here, one is to have the actual value of the error code but I'd put syntax error reporting above error code matching (-Command vs -File). The only solutions I had for this are terrible.
The text was updated successfully, but these errors were encountered: