Search found 11743 matches

by jvierra
Tue Jan 16, 2018 6:31 pm
Forum: Windows PowerShell
Topic: Combing 2 objects
Replies: 9
Views: 269

Re: Combing 2 objects

You have to have an accurate representation of what you are trying to do. The code you posted was for two single objects. If there are multiples then you will have to enumerate them correctly.
by jvierra
Tue Jan 16, 2018 5:24 pm
Forum: Windows PowerShell
Topic: Combing 2 objects
Replies: 9
Views: 269

Re: Combing 2 objects

That is what the code I posted does.
by jvierra
Tue Jan 16, 2018 3:26 pm
Forum: PowerShell GUIs
Topic: Function Grief!!!
Replies: 7
Views: 201

Re: Function Grief!!!

First of all, what is the point of this. It seems like a lot of code to get a list of numbers, The following are all equivalent: Function Positions([string]$program, [string]$variable) { #assignments $p1 = 5 $p2 = 10 $p3 = 15 $p4 = 20 $p5 = 25 $p6 = 30 $p7 = 35 $p8 = 40 $p9 = 45 $p10 = 50 $p11 = 55 ...
by jvierra
Tue Jan 16, 2018 2:12 pm
Forum: PowerShell GUIs
Topic: Old Project Skewed when opened on HIGH DPI LCD
Replies: 9
Views: 342

Re: Old Project Skewed when opened on HIGH DPI LCD

Also it might be useful to create a new account and try the form from that account. Making changes to the theme and display settings can mess up some adapters and drivers. The display reports to the OS are done through the drivers. They know what the display is. Changes we make to the UI and theme o...
by jvierra
Tue Jan 16, 2018 12:17 pm
Forum: Windows PowerShell
Topic: Combing 2 objects
Replies: 9
Views: 269

Re: Combing 2 objects

This is easier and more reliable: [array]$m_Array = if (objA.ComputerName -eq objB.ComputerName) { [pscustomobject]@{ ComputerName = $objA.ComputerName Soruce = $objA.Soruce Port = $objA.Port Path1 = $objB.path1 Path2 = $objA.Path2 Path3 = $objA.Path3 } } $m_Array You cannot have two properties with...
by jvierra
Tue Jan 16, 2018 9:38 am
Forum: PowerShell GUIs
Topic: Combobox - Readonly Property Possible?
Replies: 4
Views: 79

Re: Combobox - Readonly Property Possible?

Look more closely at the options. Set it to only take entries from the list. It will then not be editable.
by jvierra
Tue Jan 16, 2018 7:28 am
Forum: PowerShell GUIs
Topic: Change Combobox Item Text
Replies: 2
Views: 75

Re: Change Combobox Item Text

You can't. Use a ListBox.
by jvierra
Mon Jan 15, 2018 12:33 pm
Forum: PowerShell GUIs
Topic: Pass progressbar into function - property not found
Replies: 5
Views: 144

Re: Pass progressbar into function - property not found

Yes. That is another way to do this. It takes more code and is much less flexible. You can name the job and the progressbar the same and do this in one line. "Find" will find the control even if it is inside of a container. $pbar = $form.Controls.Find($job.Name,$true) Controls.Find(String key,Boolea...
by jvierra
Mon Jan 15, 2018 9:50 am
Forum: PowerShell GUIs
Topic: Pass progressbar into function - property not found
Replies: 5
Views: 144

Re: Pass progressbar into function - property not found

You will need multiple update statements or access the control by name.

$form1.Controls['Myprogressbar'].Value

or

$form1.Controls[$Myprogressbarname].Value
by jvierra
Mon Jan 15, 2018 9:10 am
Forum: PowerShell GUIs
Topic: Pass progressbar into function - property not found
Replies: 5
Views: 144

Re: Pass progressbar into function - property not found

It is not necessary for you to pass a control to a function. The controls in a form are global to the form. Just reference the control by name.