Title: AvoidUsingPositionalParameters : This rule only fires for the cmdlets / functions loaded in the default runspace · Issue #893 · PowerShell/PSScriptAnalyzer · GitHub
Open Graph Title: AvoidUsingPositionalParameters : This rule only fires for the cmdlets / functions loaded in the default runspace · Issue #893 · PowerShell/PSScriptAnalyzer
X Title: AvoidUsingPositionalParameters : This rule only fires for the cmdlets / functions loaded in the default runspace · Issue #893 · PowerShell/PSScriptAnalyzer
Description: Same behavior that this issue #883 Steps to reproduce $sb={ Function Get-MyCommand { param( [Parameter(Mandatory=$true,Position=1)] $A, [Parameter(Position=2)] $B, [Parameter(Position=3)] $C ) "Test" } Get-MyCommand Get-ChildItem Microso...
Open Graph Description: Same behavior that this issue #883 Steps to reproduce $sb={ Function Get-MyCommand { param( [Parameter(Mandatory=$true,Position=1)] $A, [Parameter(Position=2)] $B, [Parameter(Position=3)] $C ) "Tes...
X Description: Same behavior that this issue #883 Steps to reproduce $sb={ Function Get-MyCommand { param( [Parameter(Mandatory=$true,Position=1)] $A, [Parameter(Position=2)] $B, [Parameter(Position=3)] $C ) &quo...
Opengraph URL: https://github.com/PowerShell/PSScriptAnalyzer/issues/893
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"AvoidUsingPositionalParameters : This rule only fires for the cmdlets / functions loaded in the default runspace","articleBody":"Same behavior that this issue [#883](https://github.com/PowerShell/PSScriptAnalyzer/issues/883)\r\n\r\nSteps to reproduce\r\n------------------\r\n```powershell \r\n $sb={\r\n Function Get-MyCommand {\r\n param( \r\n [Parameter(Mandatory=$true,Position=1)] \r\n $A,\r\n \r\n [Parameter(Position=2)]\r\n $B,\r\n \r\n [Parameter(Position=3)]\r\n $C\r\n )\r\n \"Test\"\r\n }\r\n Get-MyCommand Get-ChildItem Microsoft.PowerShell.Management System.Management.Automation.Cmdlet\r\n }\r\n Invoke-ScriptAnalyzer -ScriptDefinition \"$sb\"\r\n ```\r\n\r\nExpected behavior\r\n-----------------\r\nThe rule is triggered.\r\n\r\nActual behavior\r\n---------------\r\nThis rule does not fire because it only calls the [GetCommandInfo()](https://github.com/PowerShell/PSScriptAnalyzer/blob/010445107423e90907c59e9bac8cc7404785ca19/Rules/AvoidPositionalParameters.cs#L51) method.\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\nPSVersion 5.1.14409.1012\r\nPSEdition Desktop\r\nPSCompatibleVersions {1.0, 2.0, 3.0, 4.0, 5.0, 5.1.14409.1012}\r\nBuildVersion 10.0.14409.1012\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\r\n> (Get-Module -ListAvailable PSScriptAnalyzer).Version | ForEach-Object { $_.ToString() }\r\n1.16.1\r\n1.16.0\r\n```\r\n","author":{"url":"https://github.com/LaurentDardenne","@type":"Person","name":"LaurentDardenne"},"datePublished":"2018-02-17T09:31:55Z","url":"https://github.com/PowerShell/PSScriptAnalyzer/issues/893"}
| 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:ddd5ceb4-5cd6-4262-7311-18e7850f15a1 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9718:1340EC:6AC05F:8C3BA2:6AFCF45D |
| html-safe-nonce | ba59e2ced4693ae44f5a0433af1700b9146465996211c33d7742aa449eeaba27 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NzE4OjEzNDBFQzo2QUMwNUY6OEMzQkEyOjZBRkNGNDVEIiwidmlzaXRvcl9pZCI6IjY4NjA3OTc5MDU5MzQ4MDgxNTciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | f4baa271e8bb7fac16a42b9a11dbde696d2a25e87d6ff182d89b574c5fd0bc19 |
| hovercard-subject-tag | issue:297992275 |
| 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/893/issue_layout |
| twitter:image | https://opengraph.githubassets.com/662d5a0b6c95bde9d3d4e8bd1f646245d28d0d1ee100c0b6b9868e84bfbca2b4/PowerShell/PSScriptAnalyzer/issues/893 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/662d5a0b6c95bde9d3d4e8bd1f646245d28d0d1ee100c0b6b9868e84bfbca2b4/PowerShell/PSScriptAnalyzer/issues/893 |
| og:image:alt | Same behavior that this issue #883 Steps to reproduce $sb={ Function Get-MyCommand { param( [Parameter(Mandatory=$true,Position=1)] $A, [Parameter(Position=2)] $B, [Parameter(Position=3)] $C ) "Tes... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | LaurentDardenne |
| 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