Title: PSUseCmdletCorrectly breaks on Write-Verbose -Verbose · Issue #1624 · PowerShell/PSScriptAnalyzer · GitHub
Open Graph Title: PSUseCmdletCorrectly breaks on Write-Verbose -Verbose · Issue #1624 · PowerShell/PSScriptAnalyzer
X Title: PSUseCmdletCorrectly breaks on Write-Verbose -Verbose · Issue #1624 · PowerShell/PSScriptAnalyzer
Description: I'm getting a rule violation when we force Write-Verbose to have output like this: Write-Verbose -Verbose "My Message" Steps to reproduce Invoke-ScriptAnalyzer -ScriptDefinition ' Write-Verbose -Verbose "Getting file list from $pwd" Writ...
Open Graph Description: I'm getting a rule violation when we force Write-Verbose to have output like this: Write-Verbose -Verbose "My Message" Steps to reproduce Invoke-ScriptAnalyzer -ScriptDefinition ' Write-Verbose -Ve...
X Description: I'm getting a rule violation when we force Write-Verbose to have output like this: Write-Verbose -Verbose "My Message" Steps to reproduce Invoke-ScriptAnalyzer -ScriptDefinition '...
Opengraph URL: https://github.com/PowerShell/PSScriptAnalyzer/issues/1624
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"PSUseCmdletCorrectly breaks on Write-Verbose -Verbose","articleBody":"I'm getting a rule violation when we force Write-Verbose to have output like this:\r\n\r\n```PowerShell\r\nWrite-Verbose -Verbose \"My Message\"\r\n```\r\n\r\nSteps to reproduce\r\n------------------\r\n\r\n```PowerShell\r\nInvoke-ScriptAnalyzer -ScriptDefinition '\r\nWrite-Verbose -Verbose \"Getting file list from $pwd\"\r\nWrite-Warning -Verbose \"Getting file list from $pwd\"\r\nWrite-Error -Verbose \"Getting file list from $pwd\"\r\nWrite-Error -ErrorAction SilentlyContinue \"Getting file list from $pwd\"\r\n' -IncludeRule PSUseCmdletCorrectly\r\n```\r\n\r\nExpected behavior\r\n-----------------\r\nThere are no violations.\r\n\r\nActual behavior\r\n---------------\r\n\r\n```none\r\nRuleName Severity ScriptName Line Message\r\n-------- -------- ---------- ---- -------\r\nPSUseCmdletCorrectly Warning 2 Cmdlet 'Write-Verbose' may be used incorrectly. Please\r\n check that all mandatory parameters are supplied.\r\nPSUseCmdletCorrectly Warning 3 Cmdlet 'Write-Warning' may be used incorrectly. Please\r\n check that all mandatory parameters are supplied.\r\n\r\n```\r\n\r\nI think it's significant that it has no problem with either of the Write-Error lines, but I have not looked at the code to understand what is happening ...\r\n\r\n\r\nEnvironment data\r\n----------------\r\n\r\n\u003c!-- Provide the output of the following 2 commands -->\r\n\r\n```PowerShell\r\n> $PSVersionTable\r\n\r\nName Value \r\n---- ----- \r\nPSVersion 5.1.18362.1171 \r\nPSEdition Desktop \r\nPSCompatibleVersions {1.0, 2.0, 3.0, 4.0...} \r\nBuildVersion 10.0.18362.1171 \r\nCLRVersion 4.0.30319.42000 \r\nWSManStackVersion 3.0 \r\nPSRemotingProtocolVersion 2.3 \r\nSerializationVersion 1.1.0.1 \r\n\r\n\r\n> (Get-Module -ListAvailable PSScriptAnalyzer).Version | ForEach-Object { $_.ToString() }\r\n1.19.1\r\n1.19.1\r\n```\r\n","author":{"url":"https://github.com/Jaykul","@type":"Person","name":"Jaykul"},"datePublished":"2021-01-07T16:57:13Z","url":"https://github.com/PowerShell/PSScriptAnalyzer/issues/1624"}
| 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:79a48d34-5b7e-b35a-dd48-57267e0a9ed4 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8778:10239D:6C209:8C233:6AFCFA70 |
| html-safe-nonce | 697fceca280b386cd17b82eb68095fa18f9af44e9437e0c0bced291f46314241 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4Nzc4OjEwMjM5RDo2QzIwOTo4QzIzMzo2QUZDRkE3MCIsInZpc2l0b3JfaWQiOiI1MTc0OTY2ODIzNTY0NDA5NDU2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | dae6020a1dd15f2c0af13e547c5fc6c69ac1441edfc7cfc70bc4108cd6d04ef5 |
| hovercard-subject-tag | issue:781459919 |
| 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/1624/issue_layout |
| twitter:image | https://opengraph.githubassets.com/70670aceaffe419614d83ba7202c4af0a08f6a746f4e7732f74d05a70700418d/PowerShell/PSScriptAnalyzer/issues/1624 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/70670aceaffe419614d83ba7202c4af0a08f6a746f4e7732f74d05a70700418d/PowerShell/PSScriptAnalyzer/issues/1624 |
| og:image:alt | I'm getting a rule violation when we force Write-Verbose to have output like this: Write-Verbose -Verbose "My Message" Steps to reproduce Invoke-ScriptAnalyzer -ScriptDefinition ' Write-Verbose -Ve... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Jaykul |
| hostname | github.com |
| expected-hostname | github.com |
| None | cfabad6ee26d2b84c7afef4ae0cc71b8b692fb9d66f9f15997652ef991bfd3f4 |
| 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 | 35f85b78676038389558a41adf8d76e474592ede |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width