PowerShellEditorServices icon indicating copy to clipboard operation
PowerShellEditorServices copied to clipboard

Sometimes when typing `[type]::` you get no completions

Open SeeminglyScience opened this issue 3 years ago • 3 comments

This happens because we get a completion request for [type]: which gets no results and for some reason isn't marked as incomplete. Need to look into how to fix that.

SeeminglyScience avatar May 20 '22 18:05 SeeminglyScience

It can also happen when typing something like: Get-NetAdapter - or Get-Disk - but only if you've CD'ed into an empty folder and the modules haven't been imported yet.

MartinGC94 avatar Aug 03 '24 20:08 MartinGC94

Are there any new updates? Has this been abandoned? It sounds like it used to be a higher priority but is now on the back burner?

Thanks for any information you can provide!

If anyone finds this helpful, I have started using a PS 7 session in ISE so that I can have the desired IntelliSense experience. It looks a bit odd/clunky but has been working for me so far.

$Process = Start-Process PWSH -ArgumentList @("-NoExit") -PassThru -WindowStyle Hidden

function New-OutOfProcRunspace {
    param($ProcessId)

    $ci = New-Object -TypeName System.Management.Automation.Runspaces.NamedPipeConnectionInfo -ArgumentList @($ProcessId)
    $tt = [System.Management.Automation.Runspaces.TypeTable]::LoadDefaultTypeFiles()

    $Runspace = [System.Management.Automation.Runspaces.RunspaceFactory]::CreateRunspace($ci, $Host, $tt)

    $Runspace.Open()
    $Runspace
}

$Host.PushRunspace($(New-OutOfProcRunspace -ProcessId $Process.Id))

haverland389 avatar Nov 05 '25 18:11 haverland389

There's a more manual, but easier to remember way: Launch pwsh and type in $pid. Copy the pid and from ISE type in Enter-PSHostProcess 123 (the PID from before).
It's nice to not only get a better IntelliSense experience, but also better syntax highlighting (even if it doesn't support the newer syntax sugar).

MartinGC94 avatar Nov 05 '25 18:11 MartinGC94