Controllo interno WPF ISE PowerShell
-
06-07-2019 - |
Domanda
Ho sentito che PowerShell ISE utilizza lo stesso editor di testo WPF di VisualStudio 2010 e Oslo IntelliPad. So che puoi estendere questo editor in VisualStudio inserendo il tuo controllo WPF nel file XAML dell'editor. La mia domanda ora: è possibile anche con PowerShellISE? Qualcuno ha ancora provato a farlo?
Soluzione
È vero che è lo stesso controllo. Non credo che tu possa inserire il tuo controllo WPF. Tuttavia, l'ISE è completamente programmatico e ha un modello a oggetti che è possibile utilizzare per personalizzare l'ISE. È possibile accedere al modello a oggetti con la variabile $ psise. Puoi modificare molte opzioni con $ 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
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow