Search found 11479 matches

by jvierra
Tue Nov 14, 2017 5:38 pm
Forum: PowerShell GUIs
Topic: Design of pstudio winforms apps re. pester
Replies: 8
Views: 231

Re: Design of pstudio winforms apps re. pester

An event is a function. It is an anonymous function. In PowerShell a function is really a named scriptblock. An event can take a function pointer (delegate) and it can be named or anonymous.

Just tell Pester to test eh function.
by jvierra
Tue Nov 14, 2017 3:00 pm
Forum: Windows PowerShell
Topic: Run is producing this error but run in console does not
Replies: 2
Views: 93

Re: Run is producing this error but run in console does not

This error: "File \\braunlift.com\share\Home Drives\chris_hartmann\PowerShell_Scripts\User-Profiles\Get-UserProfile.ps1 cannot be loaded. The file ERROR: \\braunlift.com\share\Home Drives\chris_hartmann\PowerShell_Scripts\User-Profiles\Get-UserProfile.ps1 is not digitally signed. You cannot run this...
by jvierra
Tue Nov 14, 2017 12:23 pm
Forum: PowerShell GUIs
Topic: Output is formatted differently after build
Replies: 17
Views: 244

Re: Output is formatted differently after build

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.
by jvierra
Tue Nov 14, 2017 10:46 am
Forum: PowerShell GUIs
Topic: Output is formatted differently after build
Replies: 17
Views: 244

Re: Output is formatted differently after build

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.
by jvierra
Tue Nov 14, 2017 10:37 am
Forum: PowerShell GUIs
Topic: Output is formatted differently after build
Replies: 17
Views: 244

Re: Output is formatted differently after build

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 us...
by jvierra
Tue Nov 14, 2017 10:36 am
Forum: PowerShell GUIs
Topic: Output is formatted differently after build
Replies: 17
Views: 244

Re: Output is formatted differently after build

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 us...
by jvierra
Tue Nov 14, 2017 10:35 am
Forum: PowerShell GUIs
Topic: Output is formatted differently after build
Replies: 17
Views: 244

Re: Output is formatted differently after build

Try the following command as I've seen it working with RichTextBox. "... | Out-string -width 1000" Hope this help! Using Format-Table -auto combined with Out-String helps to stabilize the result. Setting DPI mode also helps to maintain translation from PSS to hi-rez monitors. All require using a "f...
by jvierra
Tue Nov 14, 2017 10:32 am
Forum: PowerShell GUIs
Topic: Output is formatted differently after build
Replies: 17
Views: 244

Re: Output is formatted differently after build

Works for me when I build. Did you try my PSF example to seem how it behaves and how it can be easily resized.
by jvierra
Tue Nov 14, 2017 10:19 am
Forum: PowerShell GUIs
Topic: Output is formatted differently after build
Replies: 17
Views: 244

Re: Output is formatted differently after build

The default for Out-String is as follows: -Width Specifies the number of characters in each line of output. Any additional characters are truncated, not wrapped. If you omit this parameter, the width is determined by the characteristics of the host program. The default value for the Windows PowerShe...
by jvierra
Tue Nov 14, 2017 10:17 am
Forum: PowerShell GUIs
Topic: Output is formatted differently after build
Replies: 17
Views: 244

Re: Output is formatted differently after build

For textbox you need to set a compatible fixed font. Be sure to change the form AutoscaleMode to DPI. The TextBox control does not truncate or expand columns. If you use Out-String the width will get interpreted. Use Format-Table. Also build for Windows Forms latest version. This code works and disp...