by bashinator · 11y ago · 0 comments
In PowerShell 5 (at least in Windows 10), Ctrl-Space yields a list of matching completions. You can then use the arrow keys (ip, down, left, right) to pick one and hit enter or space to select.
It works for commands as well as for options/parameters and parameter values.
I.e. you can type get-pr[ctrl-space] and powershell responds with:
Get-PrintConfiguration Get-PrinterDriver Get-PrinterProperty Get-Process
Get-Printer Get-PrinterPort Get-PrintJob Get-ProvisionedAppxPackage
Choose Get-Process (right,right,right,space). Now the cmdline shows Get-Process _
Hit [-][ctrl-space]. Powershell now shows: PS C:\Users\zaphod> Get-Process -Name
Name IncludeUserName FileVersionInfo ErrorAction ErrorVariable OutVariable
Id ComputerName Verbose WarningAction WarningVariable OutBuffer
InputObject Module Debug InformationAction InformationVariable PipelineVariable
Pick "Name" and hit space: PS C:\Users\zaphod> Get-Process -Name _
Now hit [ctrl-space] again. PowerShell now completes on running processes on the system, offering the list of all of the process names.Personally I don't think this is elegant, but that's what I usually encounter in the wild.
But yeah, I don't like the cycling, either. I'd also prefer to get a list of the possible completions.