File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
src/PowerShellEditorServices/Services/DebugAdapter Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -680,8 +680,20 @@ private async Task<VariableContainerDetails> FetchVariableContainerAsync(string
680
680
var scopeVariableContainer = new VariableContainerDetails ( this . nextVariableId ++ , "Scope: " + scope ) ;
681
681
this . variables . Add ( scopeVariableContainer ) ;
682
682
683
- IReadOnlyList < PSObject > results = await _executionService . ExecutePSCommandAsync < PSObject > ( psCommand , CancellationToken . None )
684
- . ConfigureAwait ( false ) ;
683
+ IReadOnlyList < PSObject > results ;
684
+ try
685
+ {
686
+ results = await _executionService . ExecutePSCommandAsync < PSObject > ( psCommand , CancellationToken . None )
687
+ . ConfigureAwait ( false ) ;
688
+ }
689
+ catch ( CmdletInvocationException ex )
690
+ {
691
+ if ( ! ex . ErrorRecord . CategoryInfo . Reason . Equals ( "PSArgumentOutOfRangeException" ) )
692
+ {
693
+ throw ;
694
+ }
695
+ results = null ;
696
+ }
685
697
686
698
if ( results != null )
687
699
{
You can’t perform that action at this time.
0 commit comments