diff --git a/src/PowerShellEditorServices/Language/LanguageService.cs b/src/PowerShellEditorServices/Language/LanguageService.cs index 57b0eef4c..f808a2a1d 100644 --- a/src/PowerShellEditorServices/Language/LanguageService.cs +++ b/src/PowerShellEditorServices/Language/LanguageService.cs @@ -481,6 +481,15 @@ await CommandHelpers.GetCommandInfo( IEnumerable commandParamSets = commandInfo.ParameterSets; return new ParameterSetSignatures(commandParamSets, foundSymbol); } + catch (RuntimeException e) + { + // A RuntimeException will be thrown when an invalid attribute is + // on a parameter binding block and then that command/script has + // its signatures resolved by typing it into a script. + Logger.WriteException("RuntimeException encountered while accessing command parameter sets", e); + + return null; + } catch (InvalidOperationException) { // For some commands there are no paramsets (like applications). Until