{"action":"created","issue":{"url":"https://api.github.com/repos/chef/chef/issues/3455","labels_url":"https://api.github.com/repos/chef/chef/issues/3455/labels{/name}","comments_url":"https://api.github.com/repos/chef/chef/issues/3455/comments","events_url":"https://api.github.com/repos/chef/chef/issues/3455/events","html_url":"https://github.com/chef/chef/pull/3455","id":83103657,"number":3455,"title":"Issue #3455: powershell_script: do not allow suppression of syntax errors","user":{"login":"adamedx","id":2422125,"avatar_url":"https://avatars.githubusercontent.com/u/2422125?v=3","gravatar_id":"","url":"https://api.github.com/users/adamedx","html_url":"https://github.com/adamedx","followers_url":"https://api.github.com/users/adamedx/followers","following_url":"https://api.github.com/users/adamedx/following{/other_user}","gists_url":"https://api.github.com/users/adamedx/gists{/gist_id}","starred_url":"https://api.github.com/users/adamedx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamedx/subscriptions","organizations_url":"https://api.github.com/users/adamedx/orgs","repos_url":"https://api.github.com/users/adamedx/repos","events_url":"https://api.github.com/users/adamedx/events{/privacy}","received_events_url":"https://api.github.com/users/adamedx/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/chef/chef/labels/in%20progress","name":"in progress","color":"ededed"},{"url":"https://api.github.com/repos/chef/chef/labels/Signed%20CLA","name":"Signed CLA","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-05-31T14:43:24Z","updated_at":"2015-06-26T20:08:43Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/chef/chef/pulls/3455","html_url":"https://github.com/chef/chef/pull/3455","diff_url":"https://github.com/chef/chef/pull/3455.diff","patch_url":"https://github.com/chef/chef/pull/3455.patch"},"body":"@ksubrama, @btm, @jdmundrawala  thanks for merging #3080. Here's an addendum based on a few pieces of feedback I didn't follow up on:\r\n\r\n1. Took @jdmundrawala 's feedback that preserving behavior of other script resources that let you suppress syntax errors just added complexity at the expense of obscuring a much more likely scenario: user expects a (failure) return code of 1, but the script itself has a syntax error. In that case, the script needs to be fixed by the user, but the user isn't aware because Chef reports no error. The `powershell_script` resource hasn't been around long enough to need such strict backwards compatibility to justify the complexity in code (evidenced by numerous questions in the #3080 conversation) and the difficulty of the aforementioned scenario.\r\n2. Feedback from @ksubrama and @jdmundrawala  around it not being obvious how we were actually doing the syntax check by embedding user code in a PowerShell script block. That's actually the core idea of the syntax validation, so to make that more obvious, I've restructured the code generation string so that instead of a terse one-liner, it's in multiple lines and looks closer to how you'd write idiomatic PowerShell code where the block was more obvious."},"comment":{"url":"https://api.github.com/repos/chef/chef/issues/comments/115865029","html_url":"https://github.com/chef/chef/pull/3455#issuecomment-115865029","issue_url":"https://api.github.com/repos/chef/chef/issues/3455","id":115865029,"user":{"login":"ksubrama","id":9382254,"avatar_url":"https://avatars.githubusercontent.com/u/9382254?v=3","gravatar_id":"","url":"https://api.github.com/users/ksubrama","html_url":"https://github.com/ksubrama","followers_url":"https://api.github.com/users/ksubrama/followers","following_url":"https://api.github.com/users/ksubrama/following{/other_user}","gists_url":"https://api.github.com/users/ksubrama/gists{/gist_id}","starred_url":"https://api.github.com/users/ksubrama/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ksubrama/subscriptions","organizations_url":"https://api.github.com/users/ksubrama/orgs","repos_url":"https://api.github.com/users/ksubrama/repos","events_url":"https://api.github.com/users/ksubrama/events{/privacy}","received_events_url":"https://api.github.com/users/ksubrama/received_events","type":"User","site_admin":false},"created_at":"2015-06-26T20:08:43Z","updated_at":"2015-06-26T20:08:43Z","body":":+1:\r\n"}}