[PSS 2015] Extend auto-complete prevention for variables

Post feature requests, product enhancement ideas, and other product-specific suggestions here. Do not post bug reports.
Forum rules
Do not post any licensing information in this forum.
User avatar
Posts: 282
Joined: Sun Mar 03, 2013 12:45 pm

[PSS 2015] Extend auto-complete prevention for variables

Post by Bosparan » Wed Dec 09, 2015 8:37 am

Hi Guys,

recently you updated the autocomplete settings for variables, so that it wouldn't auto-complete for the first variable in foreach ($a in $b) loops (thanks again for this). While I'd still like to be able to exclude all variables from auto-completion, there is one more case where disabling it generally would make sense:

Automatic Variables (especially $_)


Code: Select all

$_Foo = "bar"
Get-ChildItem | Where-Object { $_.Length -gt 1234}
In this case, when trying to write the Where-Object scriptblock, it will erroneously autocomplete $_ to $_Foo.