We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d48438c commit 821905fCopy full SHA for 821905f
module/PowerShellEditorServices/Commands/Public/Import-EditorCommand.ps1
@@ -57,14 +57,11 @@ function Import-EditorCommand {
57
return $moduleInfo.ExportedFunctions.Values
58
}
59
60
- $flags = [Reflection.BindingFlags]'Instance, NonPublic'
61
- $extensionService = $psEditor.GetType().
62
- GetField('extensionService', $flags).
63
- GetValue($psEditor)
64
-
65
- $editorCommands = $extensionService.GetType().
66
- GetField('editorCommands', $flags).
67
- GetValue($extensionService)
+ $editorCommands = @{}
+
+ foreach ($existingCommand in $psEditor.GetCommands()) {
+ $editorCommands[$existingCommand.Name] = $existingCommand
+ }
68
69
process {
70
switch ($PSCmdlet.ParameterSetName) {
0 commit comments