Page 1 of 1

[PSS 2015] Extend auto-complete prevention for variables

Posted: Wed Dec 09, 2015 7:37 am
by Bosparan
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 $_)

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

Cheers,
Fred