question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hangs on ArgumentCompleter Debugging

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:20 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
babysnakescommented, Jan 31, 2022

@andschwa sure, I’ll try tomorrow and update.

0reactions
andschwacommented, Feb 10, 2022

No worries! That’s why it’s helpful to have enough repro info for me to step through it all. This helps narrow it down. I’ll get a debugger attached and see what’s happening when I press “Continue” that ReadLine barfs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Developers - Hangs on ArgumentCompleter Debugging -
Example Code: using namespace System.Management.Automation $MSIHelper = { param($commandName, $parameterName, $wordToComplete, $commandAst, ...
Read more >
Powershell 4.0 process hangs - how to debug? - TechNet
Hi,. I have a situation with Powershell on a Windows 2008 R2 server, with SP1. The server is Windows quad code 4GB VM....
Read more >
How to use autocomplete at the command line for dotnet, git ...
Hi, I've been wanting to start using Powershell and new Windows Terminal more but I'm kind of stuck on cmd.exe because it is...
Read more >
Having trouble installing Power Cli - VMware Communities
I have stuck with this. ... {Get-NetworkControllerDeploymentInfo, Get-NetworkControllerManagedDevices, Debug-NetworkController, Debug-Ne.
Read more >
asp net core 5.0 RC1 - Visual Studio Feedback
Debugger hangs sporadically in Visual Studio 2019 16.8 preview 3 w/ asp net ... Visual Studio will then recover, but I cannot restart...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found