Question

I have heard that the PowerShell ISE uses the same WPF text editor as VisualStudio 2010 and the Oslo IntelliPad. I know that you can extend this editor in VisualStudio by inserting your own WPF control into the editor's XAML file. My question now: Is this also possible with the PowerShellISE? Did anybody try to do this yet?

Was it helpful?

Solution

It is true that it is the same control. I do not believe you can insert your own WPF control. However, the ISE is completely programatic and has an object model that you can use to customize the ISE. You can access the object model with the $psise variable. You can tweak a lot of options with $psise.options

1 >  $psise.options


SelectedScriptPaneState       : Right
ShowToolBar                   : True
TokenColors                   : {[Attribute, #FF84A7C1], [Command, #FFFFFF60], 
                                [CommandArgument, #FFFFFFFF], [CommandParameter
                                , #FFFFDE00]...}
DefaultOptions                : Microsoft.PowerShell.Host.ISE.ISEOptions
FontSize                      : 16
FontName                      : consolas
ErrorForegroundColor          : #FFFF0000
ErrorBackgroundColor          : #00FFFFFF
WarningForegroundColor        : #FFFF8C00
WarningBackgroundColor        : #00FFFFFF
VerboseForegroundColor        : #FF0000FF
VerboseBackgroundColor        : #00FFFFFF
DebugForegroundColor          : #FF0000FF
DebugBackgroundColor          : #00FFFFFF
OutputPaneBackgroundColor     : #FF000000
OutputPaneTextBackgroundColor : #FF000000
OutputPaneForegroundColor     : #FFFFFFFF
CommandPaneBackgroundColor    : #FF000000
ScriptPaneBackgroundColor     : #FF000000
ScriptPaneForegroundColor     : #FF000000
ShowWarningForDuplicateFiles  : True
ShowWarningBeforeSavingOnRun  : True
UseLocalHelp                  : True
CommandPaneUp                 : True
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top