{"action":"created","issue":{"url":"https://api.github.com/repos/PowerShell/PSScriptAnalyzer/issues/925","repository_url":"https://api.github.com/repos/PowerShell/PSScriptAnalyzer","labels_url":"https://api.github.com/repos/PowerShell/PSScriptAnalyzer/issues/925/labels{/name}","comments_url":"https://api.github.com/repos/PowerShell/PSScriptAnalyzer/issues/925/comments","events_url":"https://api.github.com/repos/PowerShell/PSScriptAnalyzer/issues/925/events","html_url":"https://github.com/PowerShell/PSScriptAnalyzer/pull/925","id":304003550,"number":925,"title":"Do not trigger UseDeclaredVarsMoreThanAssignment for variables being used via Get-Variable","user":{"login":"bergmeister","id":9250262,"avatar_url":"https://avatars0.githubusercontent.com/u/9250262?v=4","gravatar_id":"","url":"https://api.github.com/users/bergmeister","html_url":"https://github.com/bergmeister","followers_url":"https://api.github.com/users/bergmeister/followers","following_url":"https://api.github.com/users/bergmeister/following{/other_user}","gists_url":"https://api.github.com/users/bergmeister/gists{/gist_id}","starred_url":"https://api.github.com/users/bergmeister/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bergmeister/subscriptions","organizations_url":"https://api.github.com/users/bergmeister/orgs","repos_url":"https://api.github.com/users/bergmeister/repos","events_url":"https://api.github.com/users/bergmeister/events{/privacy}","received_events_url":"https://api.github.com/users/bergmeister/received_events","type":"User","site_admin":false},"labels":[{"id":469565545,"url":"https://api.github.com/repos/PowerShell/PSScriptAnalyzer/labels/Area%20-%20Rules","name":"Area - Rules","color":"5319e7","default":false}],"state":"open","locked":false,"assignee":{"login":"bergmeister","id":9250262,"avatar_url":"https://avatars0.githubusercontent.com/u/9250262?v=4","gravatar_id":"","url":"https://api.github.com/users/bergmeister","html_url":"https://github.com/bergmeister","followers_url":"https://api.github.com/users/bergmeister/followers","following_url":"https://api.github.com/users/bergmeister/following{/other_user}","gists_url":"https://api.github.com/users/bergmeister/gists{/gist_id}","starred_url":"https://api.github.com/users/bergmeister/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bergmeister/subscriptions","organizations_url":"https://api.github.com/users/bergmeister/orgs","repos_url":"https://api.github.com/users/bergmeister/repos","events_url":"https://api.github.com/users/bergmeister/events{/privacy}","received_events_url":"https://api.github.com/users/bergmeister/received_events","type":"User","site_admin":false},"assignees":[{"login":"bergmeister","id":9250262,"avatar_url":"https://avatars0.githubusercontent.com/u/9250262?v=4","gravatar_id":"","url":"https://api.github.com/users/bergmeister","html_url":"https://github.com/bergmeister","followers_url":"https://api.github.com/users/bergmeister/followers","following_url":"https://api.github.com/users/bergmeister/following{/other_user}","gists_url":"https://api.github.com/users/bergmeister/gists{/gist_id}","starred_url":"https://api.github.com/users/bergmeister/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bergmeister/subscriptions","organizations_url":"https://api.github.com/users/bergmeister/orgs","repos_url":"https://api.github.com/users/bergmeister/repos","events_url":"https://api.github.com/users/bergmeister/events{/privacy}","received_events_url":"https://api.github.com/users/bergmeister/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2018-03-09T22:40:52Z","updated_at":"2018-03-30T18:59:18Z","closed_at":null,"author_association":"COLLABORATOR","pull_request":{"url":"https://api.github.com/repos/PowerShell/PSScriptAnalyzer/pulls/925","html_url":"https://github.com/PowerShell/PSScriptAnalyzer/pull/925","diff_url":"https://github.com/PowerShell/PSScriptAnalyzer/pull/925.diff","patch_url":"https://github.com/PowerShell/PSScriptAnalyzer/pull/925.patch"},"body":"## PR Summary\r\n\r\nFixes #831\r\n\r\nDetect the simplest possible use case `Get-Variable` and mark the variables as being used to not trigger false positives. Because there are so many ways how `Get-Variable` can be called, extracting the value of `-Name` seemed to be quite difficult to me (unless I am not aware of a helper), therefore this improvement only works for simple use cases of Get-Variable (or its alias) as `Get-Variable variableName`. I think this is OK because it is a minimum, viable improvement of triggering less false positives of the `UseDeclaredVarsMoreThanAssignment` without any side effects. \r\n\r\n## PR Checklist\r\n\r\nNote: Tick the boxes below that apply to this pull request by putting an `x` between the square brackets. Please mark anything not applicable to this PR `NA`.\r\n\r\n- [x] PR has a meaningful title\r\n    - [x] Use the present tense and imperative mood when describing your changes\r\n- [x] Summarized changes\r\n- [ ] User facing documentation needed\r\n- [x] Change is not breaking\r\n- [x] Make sure you've added a new test if existing tests do not effectively test the code changed\r\n- [x] This PR is ready to merge and is not work in progress\r\n    - If the PR is work in progress, please add the prefix `WIP:` to the beginning of the title and remove the prefix when the PR is ready\r\n"},"comment":{"url":"https://api.github.com/repos/PowerShell/PSScriptAnalyzer/issues/comments/377597067","html_url":"https://github.com/PowerShell/PSScriptAnalyzer/pull/925#issuecomment-377597067","issue_url":"https://api.github.com/repos/PowerShell/PSScriptAnalyzer/issues/925","id":377597067,"user":{"login":"bergmeister","id":9250262,"avatar_url":"https://avatars0.githubusercontent.com/u/9250262?v=4","gravatar_id":"","url":"https://api.github.com/users/bergmeister","html_url":"https://github.com/bergmeister","followers_url":"https://api.github.com/users/bergmeister/followers","following_url":"https://api.github.com/users/bergmeister/following{/other_user}","gists_url":"https://api.github.com/users/bergmeister/gists{/gist_id}","starred_url":"https://api.github.com/users/bergmeister/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bergmeister/subscriptions","organizations_url":"https://api.github.com/users/bergmeister/orgs","repos_url":"https://api.github.com/users/bergmeister/repos","events_url":"https://api.github.com/users/bergmeister/events{/privacy}","received_events_url":"https://api.github.com/users/bergmeister/received_events","type":"User","site_admin":false},"created_at":"2018-03-30T18:59:18Z","updated_at":"2018-03-30T18:59:18Z","author_association":"COLLABORATOR","body":"@JamesWTruher Ok. Done."}}
{"actor":{"display_login":"bergmeister"}}