From 1b3a8ed0cced117f2886a2f4697edb45bd6b04ac Mon Sep 17 00:00:00 2001 From: David Wilson Date: Tue, 10 May 2016 16:11:37 -0700 Subject: [PATCH] Fix return value of EditorObject.RegisterCommand This change fixes the EditorObject.RegisterCommand function to pass through the return value of the ExtensionService.RegisterCommand function so that the Register-EditorCommand cmdlet writes the correct verbose output depending on whether the command was already registered. --- src/PowerShellEditorServices/Extensions/EditorObject.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/PowerShellEditorServices/Extensions/EditorObject.cs b/src/PowerShellEditorServices/Extensions/EditorObject.cs index b5947ae6e..0a8c3810a 100644 --- a/src/PowerShellEditorServices/Extensions/EditorObject.cs +++ b/src/PowerShellEditorServices/Extensions/EditorObject.cs @@ -58,9 +58,10 @@ public EditorObject( /// Registers a new command in the editor. /// /// The EditorCommand to be registered. - public void RegisterCommand(EditorCommand editorCommand) + /// True if the command is newly registered, false if the command already exists. + public bool RegisterCommand(EditorCommand editorCommand) { - this.extensionService.RegisterCommand(editorCommand); + return this.extensionService.RegisterCommand(editorCommand); } ///