diff --git a/src/PowerShellEditorServices/Extensions/EditorObject.cs b/src/PowerShellEditorServices/Extensions/EditorObject.cs
index ecd387308..54605ebd4 100644
--- a/src/PowerShellEditorServices/Extensions/EditorObject.cs
+++ b/src/PowerShellEditorServices/Extensions/EditorObject.cs
@@ -90,6 +90,14 @@ public void UnregisterCommand(string commandName)
this.extensionService.UnregisterCommand(commandName);
}
+ ///
+ /// Returns all registered EditorCommands.
+ ///
+ /// An Array of all registered EditorCommands.
+ public EditorCommand[] GetCommands()
+ {
+ return this.extensionService.GetCommands();
+ }
///
/// Gets the EditorContext which contains the state of the editor
/// at the time this method is invoked.
diff --git a/src/PowerShellEditorServices/Extensions/ExtensionService.cs b/src/PowerShellEditorServices/Extensions/ExtensionService.cs
index ceb7245f6..82b948931 100644
--- a/src/PowerShellEditorServices/Extensions/ExtensionService.cs
+++ b/src/PowerShellEditorServices/Extensions/ExtensionService.cs
@@ -170,6 +170,16 @@ public void UnregisterCommand(string commandName)
}
}
+ ///
+ /// Returns all registered EditorCommands.
+ ///
+ /// An Array of all registered EditorCommands.
+ public EditorCommand[] GetCommands()
+ {
+ EditorCommand[] commands = new EditorCommand[this.editorCommands.Count];
+ this.editorCommands.Values.CopyTo(commands,0);
+ return commands;
+ }
#endregion
#region Events