Skip to content

Problem with $arg when using debug mode #1496

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
PatTheOche opened this issue Aug 23, 2018 · 5 comments
Closed

Problem with $arg when using debug mode #1496

PatTheOche opened this issue Aug 23, 2018 · 5 comments
Labels

Comments

@PatTheOche
Copy link

PatTheOche commented Aug 23, 2018

  • Operating system name and version: Windows 10
  • VS Code version: 1.26.1
  • PowerShell extension version: 1.8.3
  • Output from $PSVersionTable:
Name                           Value
----                           -----
PSVersion                      5.1.15063.1266
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.15063.1266
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Issue Description

I am experiencing a problem when $arg contains values and a breakpoint is used to test the code.
if $arg is empty, no problem.
after breakpoint, each F10 key use, another error is raised.
Launch.json example :

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "PowerShell",
            "request": "launch",
            "name": "PowerShell Launch Current File in Temporary Console",
            "script": "c:/svn/test/Untitled-1.ps1",
            "args": ["toto"],
            "cwd": "${file}",
            "createTemporaryIntegratedConsole": true
        }
    ]
}

Attached Logs

the error is :

System.Management.Automation.CmdletInvocationException: Le numéro de portée « 1 » dépasse le nombre de portées actives.
Nom du paramètre : scopeID
La valeur réelle était 1. ---> System.Management.Automation.PSArgumentOutOfRangeException: Le numéro de portée « 1 » dépasse le nombre de portées actives.
Nom du paramètre : scopeID
La valeur réelle était 1.
   à System.Management.Automation.SessionStateInternal.GetScopeByID(Int32 scopeID)
   à System.Management.Automation.SessionStateInternal.GetScopeByID(String scopeID)
   à System.Management.Automation.SessionStateInternal.GetVariableTableAtScope(String scopeID)
   à Microsoft.PowerShell.Commands.VariableCommandBase.GetMatchingVariables(String name, String lookupScope, Boolean& wasFiltered, Boolean quiet)
   à Microsoft.PowerShell.Commands.GetVariableCommand.ProcessRecord()
   à System.Management.Automation.CommandProcessor.ProcessRecord()
   --- Fin de la trace de la pile d'exception interne ---
   à System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)
   à System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke)
   à System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
   à System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
   à System.Management.Automation.PowerShell.InvokeWithDebugger(IEnumerable`1 input, IList`1 output, PSInvocationSettings settings, Boolean invokeMustRun)
   à System.Management.Automation.ScriptDebugger.ProcessCommand(PSCommand command, PSDataCollection`1 output)
   à Microsoft.PowerShell.EditorServices.Session.PowerShell4Operations.ExecuteCommandInDebugger[TResult](PowerShellContext powerShellContext, Runspace currentRunspace, PSCommand psCommand, Boolean sendOutputToHost, Nullable`1& debuggerResumeAction)
   à Microsoft.PowerShell.EditorServices.PowerShellContext.ExecuteCommandInDebugger[TResult](PSCommand psCommand, Boolean sendOutputToHost)
   à Microsoft.PowerShell.EditorServices.PowerShellContext.<ExecuteCommand>d__48`1.MoveNext()
@rjmholt rjmholt added Issue-Bug A bug to squash. Area-Debugging labels Aug 23, 2018
@rjmholt rjmholt self-assigned this Aug 24, 2018
@rjmholt
Copy link
Contributor

rjmholt commented Oct 10, 2018

@SeeminglyScience this says "the number of scope 1 exceeds the number of active scopes", which I assume is a stack frame error that we can ignore?

@rjmholt
Copy link
Contributor

rjmholt commented Oct 10, 2018

If so, the error lies elsewhere here I think?

@rjmholt
Copy link
Contributor

rjmholt commented Oct 10, 2018

@PatTheOche Would you be able to attach your full logs here? The error you've got above is expected.

@SeeminglyScience
Copy link
Collaborator

@rjmholt Yeah I have some notes about it in this comment.

@rjmholt rjmholt removed their assignment Oct 12, 2018
@SydneyhSmith
Copy link
Collaborator

Closing this issue as inactive, will re-open if this is still an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants