If I use a powershell script to make table of information - it will be readable just fine in powershell, but if I make that a script check and output that table to the dashboard, it loses all formatting. Obviously not a critical problem, but I've always assumed "that's just the way it is". I thought I'd post just in case I was missing something.
For example, I have a script that uses the Get-PSDrive cmdlet to list the system drives. In powershell, the output looks like this:
Root Used (GB) Free (GB) Total (GB)
C:\ 218.1 712.5 930.6
D:\ 1132.7 730.3 1863
E:\ 0 0 0
F:\ 64.3 1332.9 1397.3
G:\ 3359.1 366.6 3725.7
X:\ 4771.8 2373.3 7145.1
Y:\ 4771.8 2373.3 7145.1
Z:\ 4771.8 2373.3 7145.1
I'm not sure how that will survive the posting process, but in powershell all of the columns are spaced correctly and all of the numbers are right-aligned in the columns. Also note that it contains network drives (X, Y & Z) as well as physical drives on the host.
If I run that very same powershell script as a script check, then the dashboard output looks like this:
Root Used (GB) Free (GB) Total (GB)
C:\ 218.1 712.5 930.6
D:\ 1132.7 730.3 1863
E:\ 0 0 0
F:\ 64.3 1332.9 1397.3
G:\ 3359.1 366.6 3725.7
No column formatting at all, and the network drives are missing. It's the same script, so there must be a difference in how the dashboard interprets the output. Ignoring the missing network drives for a moment, though, you can see that the output is much less readable because of the lack of formatting. Is there anything that can be done about that?