Skip to content

Commit f7278d7

Browse files
committed
Add Limitation about scriptblocks
1 parent d4534c8 commit f7278d7

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ The focus of the rename support is on quick updates to variables or functions wi
150150
❌ Dynamic Parameters are not supported
151151
❌ Dynamically constructed splat parameters will not be renamed/updated (e.g. `$splat = @{};$splat.a = 5;Do-Thing @a`)
152152
❌ Scoped variables (e.g. $SCRIPT:test) are not currently supported
153+
❌ Renaming a variable inside of a scriptblock that is used in unscoped operations like `Foreach-Parallel` or `Start-Job` and the variable is not defined within the scriptblock is not supported and can have unexpected results.
153154

154155
📄📄 Filing a Rename Issue
155156

test/PowerShellEditorServices.Test.Shared/Refactoring/Variables/_RefactorVariableTestCases.cs

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ public class RefactorVariableTestCases
1111
new ("VariableSimpleAssignment.ps1", Line: 1, Column: 1, NewName: "Bad Name", ShouldThrow: true),
1212
new ("VariableSimpleAssignment.ps1", Line: 1, Column: 6, NoResult: true),
1313
new ("VariableCommandParameter.ps1", Line: 3, Column: 17),
14+
new ("VariableCommandParameter.ps1", Line: 3, Column: 17, NewName: "-Renamed"),
1415
new ("VariableCommandParameter.ps1", Line: 10, Column: 10),
1516
new ("VariableCommandParameterSplatted.ps1", Line: 3, Column: 19 ),
1617
new ("VariableCommandParameterSplatted.ps1", Line: 21, Column: 12),

0 commit comments

Comments
 (0)