Skip to content

In PSCore RemoteSessionStateProxy.InvokeCommand throws PSNotImpemente… #576

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

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/PowerShellEditorServices/Language/LanguageService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
using Microsoft.PowerShell.EditorServices.Symbols;
using Microsoft.PowerShell.EditorServices.Utility;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
Expand Down Expand Up @@ -699,6 +698,15 @@ await this.powerShellContext.GetRunspaceHandle(

this.areAliasesLoaded = true;
}
catch (PSNotSupportedException e)
{
this.logger.Write(
LogLevel.Warning,
$"Caught PSNotSupportedException while attempting to get aliases from remote session:\n\n{e.ToString()}");

// Prevent the aliases from being fetched again - no point if the remote doesn't support InvokeCommand.
this.areAliasesLoaded = true;
}
catch (TaskCanceledException)
{
// The wait for a RunspaceHandle has timed out, skip aliases for now
Expand Down