Title: `PSUseDeclaredVarsMoreThanAssignments` and assigning multiple variables · Issue #2164 · PowerShell/PSScriptAnalyzer · GitHub
Open Graph Title: `PSUseDeclaredVarsMoreThanAssignments` and assigning multiple variables · Issue #2164 · PowerShell/PSScriptAnalyzer
X Title: `PSUseDeclaredVarsMoreThanAssignments` and assigning multiple variables · Issue #2164 · PowerShell/PSScriptAnalyzer
Description: Aside from the false positive issues with the PSUseDeclaredVarsMoreThanAssignments rule, it has also a false negative bug: This concerns assigning multiple variables: This (as the only script line), correctly reports a PSUseDeclaredVarsM...
Open Graph Description: Aside from the false positive issues with the PSUseDeclaredVarsMoreThanAssignments rule, it has also a false negative bug: This concerns assigning multiple variables: This (as the only script line)...
X Description: Aside from the false positive issues with the PSUseDeclaredVarsMoreThanAssignments rule, it has also a false negative bug: This concerns assigning multiple variables: This (as the only script line)...
Opengraph URL: https://github.com/PowerShell/PSScriptAnalyzer/issues/2164
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`PSUseDeclaredVarsMoreThanAssignments` and assigning multiple variables","articleBody":"Aside from the false _positive_ issues with the `PSUseDeclaredVarsMoreThanAssignments` rule, it has also a false _negative_ bug:\n\nThis concerns [assigning multiple variables](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_assignment_operators#assigning-multiple-variables):\n\nThis (as the only script line), correctly reports a `PSUseDeclaredVarsMoreThanAssignments` volitation on `$a`:\n\n```PowerShell\n$a = $null\n```\n\nBut this doesn't:\n```PowerShell\n$a, $b = $null\n```\n\n---\n```PowerShell\nPSScriptAnalyzer version: 1.24.0\n\nName Value\n---- -----\nPSVersion 7.5.4\nPSEdition Core\nGitCommitId 7.5.4\nOS Microsoft Windows 10.0.26100\nPlatform Win32NT\nPSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}\nPSRemotingProtocolVersion 2.3\nSerializationVersion 1.1.0.1\nWSManStackVersion 3.0\n```","author":{"url":"https://github.com/iRon7","@type":"Person","name":"iRon7"},"datePublished":"2026-03-17T13:45:59Z","url":"https://github.com/PowerShell/PSScriptAnalyzer/issues/2164"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:a782627a-15de-d64d-9d7d-e6752e16c3ec |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D9B8:F08E5:20226A:2C8077:6AFCE20C |
| html-safe-nonce | 8305d9b97177c5b33d214c7ffe373e245fdf4983ae2545f814aba0b7489fa825 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEOUI4OkYwOEU1OjIwMjI2QToyQzgwNzc6NkFGQ0UyMEMiLCJ2aXNpdG9yX2lkIjoiNTA0NTE3ODI5Nzc2ODI3MjM5NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 6a03309b9c43291e3ee1da3e9d7f72d439464bcda7f15140c447ea990130e0df |
| hovercard-subject-tag | issue:4088675451 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PowerShell/PSScriptAnalyzer/2164/issue_layout |
| twitter:image | https://opengraph.githubassets.com/79b666c0e769e16b22851b864f48f5577146d53213a0291e31b989ba8cd896ca/PowerShell/PSScriptAnalyzer/issues/2164 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/79b666c0e769e16b22851b864f48f5577146d53213a0291e31b989ba8cd896ca/PowerShell/PSScriptAnalyzer/issues/2164 |
| og:image:alt | Aside from the false positive issues with the PSUseDeclaredVarsMoreThanAssignments rule, it has also a false negative bug: This concerns assigning multiple variables: This (as the only script line)... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | iRon7 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 0c05b7eb5b95e29725d01bb1f560a020e3fafd0f033c6b9ed3918fa3161254dd |
| turbo-cache-control | no-preview |
| go-import | github.com/PowerShell/PSScriptAnalyzer git https://github.com/PowerShell/PSScriptAnalyzer.git |
| octolytics-dimension-user_id | 11524380 |
| octolytics-dimension-user_login | PowerShell |
| octolytics-dimension-repository_id | 33149177 |
| octolytics-dimension-repository_nwo | PowerShell/PSScriptAnalyzer |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 33149177 |
| octolytics-dimension-repository_network_root_nwo | PowerShell/PSScriptAnalyzer |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 79d9154e55368884c8c93766ba4fee076343d37f |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width