OS Version: Windows 10 x64
WMF Version: 5.0
Impact: Serious Annoyance
Autocomplete and Primal Sense will mark and auto-insert a function as soon as you finish a recognized verb. This is in general benign, as I can keep typing to refine the proposed insert or select it in the primal sense window.
However, this does not work well when certain powershell statements have the same name as some verbs, or when an type accelerator has the same name as a legit verb.
Typically affected are:
- Process-Statement (Process is not an officially sanctioned verb, but still finds frequent enough usage)
- Switch-Accelerator (System.Management.Automation.SwitchParameter)
1) Install any of the following modules:
- HPOACmdlets (HP PowerShell Management Kit)
These include cmdlets using the verb "Switch"
2) Recreate PSS Cache
3) Type this in the console ("|" is the current cursor position)
Code: Select all
$foo = "bar"
5) Type space to continue a typical switch statement. Autocomplete will now insert the selected cmdlet
Notes on Solution:
An idea I had was to mark for autocomplete only once one adds [Verb] + [-]. In the example above, that would mean only provide autocomplete once the user types "Switch-", rather than how it is now already after "Switch". This would remove all collisions with statements and accelerators.