Skip to content

Add UseUsingScopeModifierInNewRunspaces rule#1419

Merged
bergmeister merged 59 commits intoPowerShell:masterfrom
Jawz84:1410_foreach_parallel_rule
Mar 24, 2020
Merged

Add UseUsingScopeModifierInNewRunspaces rule#1419
bergmeister merged 59 commits intoPowerShell:masterfrom
Jawz84:1410_foreach_parallel_rule

Conversation

@Jawz84
Copy link
Contributor

@Jawz84 Jawz84 commented Feb 17, 2020

PR Summary

Fixes #1410

  • write tests
  • write documentation
  • draft rudimentary rule
  • tune rule until all tests for this rule pass (except the test for built-in vars)
  • adapt other rules that start failing
  • add support for built-in variable detection
  • expand functionality to other commands /situations where this check makes sense
    • added support for InlineScript, Start-(Thread)Job and Invoke-Command
  • finetune
  • implement suggested correction (Replace $var with $using:var)
    • add test for suggested correction
  • refactor to AstVisitor/AstVisitor2
  • add support for DSC Script Resource (SetScript, GetScript, TestScript)

PR Checklist

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New rule for ForEach-Object -Parallel that helps users pinpoint problems with their variable scoping

4 participants