Skip to content

Hangs on ArgumentCompleter Debugging #3256

Closed
@JustinGrote

Description

@JustinGrote

Example Code:

using namespace System.Management.Automation
$MSIHelper = {
    param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameters)

    if ($GLOBAL:ACDebug) {
        $CommandName | Write-Host -fore darkgreen
        $ParameterName | Write-Host -fore darkcyan
        $wordToComplete | Write-Host -fore darkyellow
        $commandAst | ft | Out-String | Write-Host -fore magenta
        $fakeBoundParameters | ft | out-string | write-host -fore green
    }
    [CompletionResult]::new(
        'test', #completionText
        'testListItem', #listItemText
        [CompletionResultType]::ParameterValue, #resultType
        'testToolTip' #toolTip
    )
}
Register-ArgumentCompleter -CommandName New-AzureADServiceAppRoleAssignment -ScriptBlock $MSIHelper

When dotsourcing this from a file and then starting interactive debug with F5, upon attempting the completion it starts debug and stops at the correct line and displays all the info, however the console is hung and none of the debug buttons (run, step into/out/etc) work. Stop does work, but the integrated console totally hangs and requires a restart.
image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions