Currently im executing job then when it finish i read log form this job and im displaying it line by line by New-UDTypography
Its working its nice but not live
Since my scripts execution can take quite a few seconds i decided that i need a live output log.
I read forum and only working solution was using New-UDCodeEditor trick.
I implemented it and its working (kind of) but i think this is not best suited for this job
So here are my questions:
is there any other element that can display multiline output log except UDCodeEditor ?
if not can I disable all unnecessary UDCodeEditor features ? Mostly im speaking about code preview on the right.
is there any chance for dedicated command for this purpose ? Or maybe not strictly dedicated for job output but command that can display multiline ? I think it might by useful in other purposes as well ?
1 - You could use something like New-UDSyntaxEditor. It doesn’t support Add-UDElement but you could use some combination of Sync-UDElement to update it live.
You might be able to use a pre tag with UDElement and then use Add-UDElement.
New-UDElement -Tag 'pre' -Id 'output' -Content {}
2 - There are a trillion options that you can pass into the editor but we don’t have parameters for each one. You can use the -Options parameter to adjust those.
New-UDCodeEditor -Options @{
codeLens = $false
}
UDTextbox supports multline. You could also make it readonly.
thx
i think this codeLens option will do the job. i tried to browse for all parameters but this one is not implemented. i should read docs before copying script from forum
i will also try UDTextbox but i think it will make more problems than Code Editor
ok now i was able to actually check it.
First option - haven’t get thru it (seems a little to complicated)
Second option - actually there is -HideCodeLens switch in Code editor and I was using it but it does not hide the lens …
With
-Options @{
codeLens = $false
I got an error
An error occurred: Parameter set cannot be resolved using the specified named parameters. One or more parameters issued cannot be used together or an insufficient number of parameters were provided.
Endpoint: 25f68209-a229-4d06-9cec-d30556b940f2
at 25f68209-a229-4d06-9cec-d30556b940f2: line 4
at Show-UDModal, C:\Program Files (x86)\Universal\Modules\Universal\UniversalDashboard.MaterialUI.psm1: line 14941
Third option actually worked pretty well. Disabled multi line udtextbox is closest to what i want to achieve (except maybe that text is grayed out , but i can live with that or maybe we can change color of this text by style ?)