Output is formatted differently after build

Ask questions about creating Graphical User Interfaces (GUI) in PowerShell and using WinForms controls.
Forum rules
Do not post any licensing information in this forum.
User avatar
jvierra
Posts: 11479
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: Output is formatted differently after build

Post by jvierra » Tue Nov 14, 2017 10:37 am

jvierra wrote:
Tue Nov 14, 2017 10:36 am
CitrixITM wrote:
Tue Nov 14, 2017 10:29 am
Thanks, I did attempt to use out-string, but it had no effect. Below is my code. I'm surprised that it works fine in the Studio, but not fine once built. Is that normal?

$VMInfoFormated = $VMInfo | Format-Table -AutoSize | Out-String -Width 250
$textboxOutput.AppendText("$VMInfoFormated")
Do not use "AppendText". Use $textboxOutput.Lines as this will flow better.

User avatar
CitrixITM
Posts: 117
Joined: Tue Mar 01, 2016 8:28 am

Re: Output is formatted differently after build

Post by CitrixITM » Tue Nov 14, 2017 10:38 am

Yes, your example works fine. Mine doesn't. :)

User avatar
jvierra
Posts: 11479
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: Output is formatted differently after build

Post by jvierra » Tue Nov 14, 2017 10:46 am

Check all properties on my listbox against you properties. Make your width 1000 to be sure.

You will have to troubleshoot this as we cannot run your system.

User avatar
CitrixITM
Posts: 117
Joined: Tue Mar 01, 2016 8:28 am

Re: Output is formatted differently after build

Post by CitrixITM » Tue Nov 14, 2017 12:03 pm

Thank you! I found that there was an out-string somewhere else so I was doing it twice. Once I added the width to the first out-string, it worked fine.

Thank you,
Brian

User avatar
mxtrinidad
Site Admin
Posts: 23
Joined: Sun Mar 03, 2013 12:42 pm

Re: Output is formatted differently after build

Post by mxtrinidad » Tue Nov 14, 2017 12:11 pm

Curious! Can you please provide the PowerShell Studio version?

Thanks

User avatar
jvierra
Posts: 11479
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: Output is formatted differently after build

Post by jvierra » Tue Nov 14, 2017 12:23 pm

CitrixITM wrote:
Tue Nov 14, 2017 12:03 pm
Thank you! I found that there was an out-string somewhere else so I was doing it twice. Once I added the width to the first out-string, it worked fine.

Thank you,
Brian
That happens. I do it to myself quite often. It is annoying and at times hard to find.

User avatar
CitrixITM
Posts: 117
Joined: Tue Mar 01, 2016 8:28 am

Re: Output is formatted differently after build

Post by CitrixITM » Tue Nov 14, 2017 6:18 pm

I'm running PowerShell Studio 2017 5.4.145.0.

I understand now why I was getting the result that I got. I do not understand why it worked in Studio and then gave different output once built.

User avatar
Alexander Riedel
Posts: 6325
Joined: Tue May 29, 2007 4:43 pm

Re: Output is formatted differently after build

Post by Alexander Riedel » Tue Nov 14, 2017 7:57 pm

The host in PowerShell Studio has the width set to very wide to accommodate the width of the output window.
The packaged executable uses the default powershell settings.
Alexander Riedel
SAPIEN Technologies, Inc.

Post Reply