-
Notifications
You must be signed in to change notification settings - Fork 517
Closed
Description
Issue Type: Bug
Setting a variable inside a foreach-object loop, it shows the variable as assigned but never used, when it is used outside of the foreach.
Example for replication:
$Array |ForEach-Object {$NewVar = 1};$NewVar
My original problem the first time I set $Added, it has no green squiggle line and appears fine (it recognizes the variable is used later on), but within the foreach-object the same variable is shown as being assigned but never used.:
$Added = 0
If ($Adds) {$Adds |ForEach-Object {Try {$Added += 1}Catch {}}}
$AddsElement.SetAttribute("Success",$Added)
Extension version: 1.7.0
VS Code version: Code 1.24.1 (24f62626b222e9a8313213fb64b10d741a326288, 2018-06-13T17:51:32.889Z)
OS version: Windows_NT x64 10.0.15063
System Info
Item | Value |
---|---|
CPUs | Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz (8 x 2904) |
GPU Status | 2d_canvas: enabled flash_3d: enabled flash_stage3d: enabled flash_stage3d_baseline: enabled gpu_compositing: enabled multiple_raster_threads: enabled_on native_gpu_memory_buffers: disabled_software rasterization: disabled_software video_decode: enabled video_encode: enabled vpx_decode: enabled webgl: enabled webgl2: enabled |
Memory (System) | 31.88GB (22.61GB free) |
Process Argv | C:\Program Files\Microsoft VS Code\Code.exe |
Screen Reader | no |
VM | 0% |
DamianSuess
Metadata
Metadata
Assignees
Labels
No labels