On Demand Tile PowerShell Table format problem - Still an issue

I raised this question in Aug 2017 (also opened a support-ticket)

This is still an issue in 2021.

Powershell output

Hey

Have you tried setting some character limit to the output? Like so:

Does that help at all?

Tried that, same thing unfortunately

So I tried to format my PS-output with a table and width expression.
$table = @{Expression={$.Path}; Label=“Path”; Width=60},
@{Expression={$
.‘Size(Bytes)’}; Label=“Size(Bytes)”; Width=15},
@{Expression={$.‘Size(GB)’}; Label=“Size(GB)”; Width=10},
@{Expression={$
.TimeAgoMinutes}; Label=“TimeAgoMinutes”; Width=10}

As you can see the task output is truncated. So I believe the output from the tasks output gets cut off due to a limit in SquaredUp?

The same in PS output

I would recommend that your Powershell returns data in JSON format instead of Format-Table.

Get-EventLog -LogName $Logname -EntryType $EntryType | select TimeGenerated, Source, Message -First $Top | ConvertTo-JSON 

image

Format-Table removes object data and is not easily manipulable (by a computer) as it becomes essentially text. So yes you are exposing yourself to what you’re going through.

Cheers!

Awesome, that works like a charm!

Not a problem. If you want something even more “funky” add a parameter to your task for the return format. You can set a default value and have an override in the task configuration. Like this, if the same task is launched within the OM Console, it returns “Format Table” by default. When setting up your perspective in SquaredUp set the parameter to return in JSON format and use that. Basically you’ll have 2 scripts in 1 :smiley:

Chers!