Code Editor
Code editor component for Universal Apps.
The code editor component allows you to host the Microsoft Monaco editor within your dashboards.
Creating a Code Editor
You can create a new code editor with the New-UDCodeEditor
cmdlet. Specifying the -Language
parameter will enable syntax highlighting for that language. You will need to specify a height in pixels.
![](https://docs.powershelluniversal.com/~gitbook/image?url=https%3A%2F%2F1373299915-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F8F6PrkNTG8Y34hADzKOL%252Fuploads%252Fgit-blob-dd9058831774aec9b60885c47a05a19d2b422add%252Fimage%2520%28249%29.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=4f4985e9&sv=1)
Populating Code
Use the -Code
parameter to specify code that will be populated within the code editor when it loads.
Retrieving code from another component
You can retrieve code from another component using the Get-UDElement
cmdlet and accessing the code property of the hashtable that is returned.
Setting code from another component
You can set code from another component using the Set-UDElement
cmdlet. Specify the code value in a hashtable passed to the -Properties
parameter.
Options
The documentation is for an upcoming feature of PowerShell Universal .
The Monaco editor supports a wide range of options. If you wish to use options that aren't available on the New-UDCodeEditor
cmdlet, you can use the -Options
parameter and pass a hashtable of options instead.
For a full list of options, check the IEditorConsturctionOptions interface.
Last updated