Search found 12161 matches

by jvierra
Tue May 22, 2018 12:09 pm
Forum: PowerShell GUIs
Topic: Using Job Tracker
Replies: 22
Views: 425

Re: Using Job Tracker

BY the way. This is the correct way to check job completion without a wait. It avoids constantly allocating new objects in a loop. while (-not $myJob.IsCompleted){ Using a time to check the job also provides best performance and eliminates the expensive "DoEvents" and the loop. JobTracker factors al...
by jvierra
Tue May 22, 2018 11:52 am
Forum: PowerShell GUIs
Topic: Using Job Tracker
Replies: 22
Views: 425

Re: Using Job Tracker

This addresses part of what I was trying to tell you. Your code is a bit cumbersome and is memory wasteful. When you save arrays in a task and output the array you are actually doubling the memory requirements. Use the pipeline and this will not happen. Interim results will not be saved and the task...
by jvierra
Tue May 22, 2018 8:43 am
Forum: PowerShell GUIs
Topic: How to create child form without locking parent form
Replies: 3
Views: 48

Re: How to create child form without locking parent form

All ancestor forms will lock.
by jvierra
Tue May 22, 2018 8:42 am
Forum: PowerShell GUIs
Topic: What control to use?
Replies: 2
Views: 72

Re: What control to use?

Easiest way is to create a three property object with one to display. Add the objects to the "Items" of the ComboBox and set the "DisplayMember" property you want to display. Items can be retrieved by name: Object is: DisplayName, ServerNAme, AppNAme $ComboBox.Items[1].ServerName In SelectedIndexCha...
by jvierra
Tue May 22, 2018 8:16 am
Forum: PowerShell GUIs
Topic: How to create child form without locking parent form
Replies: 3
Views: 48

Re: How to create child form without locking parent form

In PowerShell we can only create modal forms. This will always lock the main form.

You can create a separate form in a runspace that will not lock the main form but it will not be able to update the main form.

Search for examples of PowerShell runspaces.
by jvierra
Mon May 21, 2018 5:09 pm
Forum: PowerShell GUIs
Topic: Using Job Tracker
Replies: 22
Views: 425

Re: Using Job Tracker

I would also note that your code is mysteriously over worked. You should not do selections and formatting in the job. Just get the data. Once you have acquired the data you can filter it in the main. The constant conversion in the select will slow the job down. It would help if you posted formatted ...
by jvierra
Mon May 21, 2018 5:05 pm
Forum: PowerShell GUIs
Topic: Using Job Tracker
Replies: 22
Views: 425

Re: Using Job Tracker

If you are parked in an event in a loop or sitting at a wait then the main process will get a higher priority in thread selection. This includes threads in all child processes. The job tracker does not use any techniques that raise the priority of the main process. This can allow all threads a more ...
by jvierra
Mon May 21, 2018 9:38 am
Forum: PowerShell GUIs
Topic: Using Job Tracker
Replies: 22
Views: 425

Re: Using Job Tracker

If you use JobTracker you can do all of this in the UpdateScript and it will be much faster. \The job is a separate entity until you call Get-Job in a tight loop. "DoEvents" is not good way to do what you are trying to do. The JobTracker article explains this and is one reason the JobTracker was cre...
by jvierra
Mon May 21, 2018 9:15 am
Forum: PowerShell GUIs
Topic: Using Job Tracker
Replies: 22
Views: 425

Re: Using Job Tracker

You have a loop that is wasting time. while ((Get-Job -Name base).state -eq "Running") The repeated Get-Job and DoEvents is killing the process efficiency. The JobTracker doe not do this and does not place focus on the job repeatedly. Use JobTracker and set the time to one minute and the performance...
by jvierra
Sun May 20, 2018 10:15 pm
Forum: PowerShell GUIs
Topic: Using Job Tracker
Replies: 22
Views: 425

Re: Using Job Tracker

Why are you not using the Job Tracker as suggested?