Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Of Variables in For-EachObject -Begin block Not Recognized Correctly #4380

Closed
5 of 6 tasks
SetTrend opened this issue Jan 16, 2023 · 3 comments
Closed
5 of 6 tasks
Labels
Issue-Bug A bug to squash. Resolution-External Will close automatically.

Comments

@SetTrend
Copy link

Prerequisites

  • I have written a descriptive issue title.
  • I have searched all open and closed issues to ensure it has not already been reported.
  • I have read the troubleshooting guide.
  • I am sure this issue is with the extension itself and does not reproduce in a standalone PowerShell instance.
  • I have verified that I am using the latest version of Visual Studio Code and the PowerShell extension.
  • If this is a security issue, I have read the security issue reporting guidance.

Summary

The VS Code PowerShell extension doesn't correctly identify the use of variables declared in a For-EachObject -Begin block.

PowerShell Version

Name                           Value
----                           -----
PSVersion                      7.3.1
PSEdition                      Core
GitCommitId                    7.3.1
OS                             Microsoft Windows 10.0.19044
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visual Studio Code Version

Version: 1.74.3 (user setup)
Commit: 97dec172d3256f8ca4bfb2143f3f76b503ca0534
Datum: 2023-01-09T16:59:02.252Z
Electron: 19.1.8
Chromium: 102.0.5005.167
Node.js: 16.14.2
V8: 10.2.154.15-electron.0
Betriebssystem: Windows_NT x64 10.0.19044
Sandkasten: No

Extension Version

v2022.12.1

Steps to Reproduce

ForEach-Object -Begin { $idx = 1 } -Process { ++$idx; $idx; }

Visuals

PowerShell iterator issue

Logs

No response

@SetTrend SetTrend added the Issue-Bug A bug to squash. label Jan 16, 2023
@ghost ghost added the Needs: Triage Maintainer attention needed! label Jan 16, 2023
@SeeminglyScience
Copy link
Collaborator

Duplicate of PowerShell/PSScriptAnalyzer#1641

@SeeminglyScience
Copy link
Collaborator

Thanks for the report! We're tracking this in the linked issue above.

@SeeminglyScience SeeminglyScience added Resolution-External Will close automatically. and removed Needs: Triage Maintainer attention needed! labels Jan 18, 2023
@ghost ghost closed this as completed Jan 18, 2023
@ghost
Copy link

ghost commented Jan 18, 2023

This issue has been marked as external. It has been automatically closed for housekeeping purposes.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug A bug to squash. Resolution-External Will close automatically.
Projects
None yet
Development

No branches or pull requests

2 participants