{"action":"created","issue":{"url":"https://api.github.com/repos/sqlcollaborative/dbatools/issues/4243","repository_url":"https://api.github.com/repos/sqlcollaborative/dbatools","labels_url":"https://api.github.com/repos/sqlcollaborative/dbatools/issues/4243/labels{/name}","comments_url":"https://api.github.com/repos/sqlcollaborative/dbatools/issues/4243/comments","events_url":"https://api.github.com/repos/sqlcollaborative/dbatools/issues/4243/events","html_url":"https://github.com/sqlcollaborative/dbatools/issues/4243","id":371523772,"node_id":"MDU6SXNzdWUzNzE1MjM3NzI=","number":4243,"title":"Fix PSScriptAnalyzerRule - PSShouldProcess","user":{"login":"joshcorr","id":13426972,"node_id":"MDQ6VXNlcjEzNDI2OTcy","avatar_url":"https://avatars2.githubusercontent.com/u/13426972?v=4","gravatar_id":"","url":"https://api.github.com/users/joshcorr","html_url":"https://github.com/joshcorr","followers_url":"https://api.github.com/users/joshcorr/followers","following_url":"https://api.github.com/users/joshcorr/following{/other_user}","gists_url":"https://api.github.com/users/joshcorr/gists{/gist_id}","starred_url":"https://api.github.com/users/joshcorr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshcorr/subscriptions","organizations_url":"https://api.github.com/users/joshcorr/orgs","repos_url":"https://api.github.com/users/joshcorr/repos","events_url":"https://api.github.com/users/joshcorr/events{/privacy}","received_events_url":"https://api.github.com/users/joshcorr/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"joshcorr","id":13426972,"node_id":"MDQ6VXNlcjEzNDI2OTcy","avatar_url":"https://avatars2.githubusercontent.com/u/13426972?v=4","gravatar_id":"","url":"https://api.github.com/users/joshcorr","html_url":"https://github.com/joshcorr","followers_url":"https://api.github.com/users/joshcorr/followers","following_url":"https://api.github.com/users/joshcorr/following{/other_user}","gists_url":"https://api.github.com/users/joshcorr/gists{/gist_id}","starred_url":"https://api.github.com/users/joshcorr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshcorr/subscriptions","organizations_url":"https://api.github.com/users/joshcorr/orgs","repos_url":"https://api.github.com/users/joshcorr/repos","events_url":"https://api.github.com/users/joshcorr/events{/privacy}","received_events_url":"https://api.github.com/users/joshcorr/received_events","type":"User","site_admin":false},"assignees":[{"login":"joshcorr","id":13426972,"node_id":"MDQ6VXNlcjEzNDI2OTcy","avatar_url":"https://avatars2.githubusercontent.com/u/13426972?v=4","gravatar_id":"","url":"https://api.github.com/users/joshcorr","html_url":"https://github.com/joshcorr","followers_url":"https://api.github.com/users/joshcorr/followers","following_url":"https://api.github.com/users/joshcorr/following{/other_user}","gists_url":"https://api.github.com/users/joshcorr/gists{/gist_id}","starred_url":"https://api.github.com/users/joshcorr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshcorr/subscriptions","organizations_url":"https://api.github.com/users/joshcorr/orgs","repos_url":"https://api.github.com/users/joshcorr/repos","events_url":"https://api.github.com/users/joshcorr/events{/privacy}","received_events_url":"https://api.github.com/users/joshcorr/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2018-10-18T13:12:48Z","updated_at":"2018-10-18T13:54:22Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"### Summary of new feature\r\n\r\nThere are about 11 cmdlets breaking the PSShouldProcess script analyzer rule, which could be impacting cmdlet use as well as our BOH. This rule indicates that the cmdlet should call ShouldProcess to write-output when someone uses `-whatif`\r\n\r\nSee [ShouldProcess.md](https://github.com/PowerShell/PSScriptAnalyzer/blob/development/RuleDocumentation/ShouldProcess.md) for more details\r\n\r\n### Proposed technical details (if applicable)\r\nIncluding a `if ($PSCmdlet.ShouldProcess(\"Target\", \"Operation\"))` check (or something similar) around the acting code.\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/sqlcollaborative/dbatools/issues/comments/431017630","html_url":"https://github.com/sqlcollaborative/dbatools/issues/4243#issuecomment-431017630","issue_url":"https://api.github.com/repos/sqlcollaborative/dbatools/issues/4243","id":431017630,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMTAxNzYzMA==","user":{"login":"joshcorr","id":13426972,"node_id":"MDQ6VXNlcjEzNDI2OTcy","avatar_url":"https://avatars2.githubusercontent.com/u/13426972?v=4","gravatar_id":"","url":"https://api.github.com/users/joshcorr","html_url":"https://github.com/joshcorr","followers_url":"https://api.github.com/users/joshcorr/followers","following_url":"https://api.github.com/users/joshcorr/following{/other_user}","gists_url":"https://api.github.com/users/joshcorr/gists{/gist_id}","starred_url":"https://api.github.com/users/joshcorr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshcorr/subscriptions","organizations_url":"https://api.github.com/users/joshcorr/orgs","repos_url":"https://api.github.com/users/joshcorr/repos","events_url":"https://api.github.com/users/joshcorr/events{/privacy}","received_events_url":"https://api.github.com/users/joshcorr/received_events","type":"User","site_admin":false},"created_at":"2018-10-18T13:54:22Z","updated_at":"2018-10-18T13:54:22Z","author_association":"CONTRIBUTOR","body":"Thanks for the heads up. I have implemented this one before on a few projects and I usually just wrap the section of the cmdlet that is doing the changes in the following.\r\n\r\n```\r\nif($PSCmdlet.ShouldProcess(\"Creates Database: $databaseName\")){\r\n/// Changing code\r\n}\r\n```\r\n\r\nIt usually writes the output and ignores the change code, but I will double check before PR. Also plan on adding some Integration Tests for these cmdlets if they don't have them already. There are a few other PSScriptAnalyzer rules that I have questions about (like if we want to ignore Incorrect Verbs, or Plural Nouns in specific cases)."}}
{"actor":{"display_login":"joshcorr"}}