Hi, All.
I have a PS form I'm developing. If I run the script/form, and do something like get the system services, everything is returned just fine. If I package up the script as a WinForm under PS version 7.3.x, then run the same call to get the list of services from the same system, the output is truncated (in the attached images there is a horizontal scrollbar to see all the output for the non-truncated lines, but I think you'll get the idea). Here is an example:
Before packaging:
After packaging:
Is there a way, after I've packaged up the script as a WinForm in PS Studio 24, to allow for longer output per line? Is this some sort of screen buffer sizing that needs to be added to me script, or the package settings?
Thanks,
D.
Truncated Output in form
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Truncated Output in form
- Attachments
-
- ServicesOutput2.jpg (20.84 KiB) Viewed 1762 times
-
- ServicesOutput1.jpg (18.15 KiB) Viewed 1762 times
- Alexander Riedel
- Posts: 8575
- Last visit: Sat Nov 02, 2024 12:15 pm
- Been upvoted: 42 times
Re: Truncated Output in form
PowerShell's automatic formatting is based on an assumed or actual console width. When packaged, there is no console object, so it assumes a default width of 80 characters (I think).
Always make sure to run output like that through Format-Table with the desired parameters yourself.
Always make sure to run output like that through Format-Table with the desired parameters yourself.
Alexander Riedel
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
Re: Truncated Output in form
I'm slapping myself in the forehead now. I knew that, ignored it, then posted the topic. It's all fixed by adding "* | Out-String -width 175" to the output.
Well... thanks for the nudge in the right direction.
D
Well... thanks for the nudge in the right direction.
D