Skip to content

Variables in Invoke-Expression arguments do not get counted as used.  #3083

@VARider

Description

@VARider

Issue Type: Bug

When setting variables that are later used in Invoke-Expression commands, VS Code flags the variables as never used, even if they appear in the Invoke-Expression command.

  1. Set a variable
  2. Use the variable in an Invoke-Expression cmdlet.
  3. Note that VS Code flags a warning that the command is assigned but not used.

Extension version: 2020.6.0
VS Code version: Code 1.51.1 (e5a624b788d92b8d34d1392e4c4d9789406efe8f, 2020-11-10T23:34:32.027Z)
OS version: Windows_NT x64 10.0.19042

System Info
Item Value
CPUs Intel(R) Core(TM) i7-7800X CPU @ 3.50GHz (12 x 3504)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
opengl: enabled_on
protected_video_decode: unavailable_off
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 63.69GB (52.26GB free)
Process Argv --crash-reporter-id c1d64596-d05d-4a27-95a4-1f9c4a13a4af
Screen Reader no
VM 0%

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions