GUI: Progress Multiple Com Objects/Progress Bar - Responsive 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.
- angelofstealth
- Posts: 69
- Last visit: Wed Sep 28, 2022 10:04 am
Re: GUI: Progress Multiple Com Objects/Progress Bar - Responsive Form
Nevermind i found where they are and how to access them, sorry about that.
- angelofstealth
- Posts: 69
- Last visit: Wed Sep 28, 2022 10:04 am
Re: GUI: Progress Multiple Com Objects/Progress Bar - Responsive Form
Sorry for the delay in response,
jvierra,
Based on looking at the imported control set, i have implemented it into my code. Back to my previous question about the properties for a control: In the PSS application if a user selects and sets a property manually through the properties pane is that information stored anywhere within the code of the form/project? Adding a built in controlset is great but doesn't give you the full settings applied to a control. I have attached my updated code/project/test, added logging and user notification to better understand if something breaks. Thanks,
jvierra,
Based on looking at the imported control set, i have implemented it into my code. Back to my previous question about the properties for a control: In the PSS application if a user selects and sets a property manually through the properties pane is that information stored anywhere within the code of the form/project? Adding a built in controlset is great but doesn't give you the full settings applied to a control. I have attached my updated code/project/test, added logging and user notification to better understand if something breaks. Thanks,
- Attachments
-
- MainForm.psf
- (73.25 KiB) Downloaded 134 times
- angelofstealth
- Posts: 69
- Last visit: Wed Sep 28, 2022 10:04 am
Re: GUI: Progress Multiple Com Objects/Progress Bar - Responsive Form
Okay sounds good, so it is manual then. Thanks
Re: GUI: Progress Multiple Com Objects/Progress Bar - Responsive Form
- PS>$b = [System.Windows.Forms.Button]::new()
- PS>$b.Location
- IsEmpty X Y
- ------- - -
- True 0 0
- PS>$b.Bounds
- Location : {X=0,Y=0}
- Size : {Width=75, Height=23}
- X : 0
- Y : 0
- Width : 75
- Height : 23
- Left : 0
- Top : 0
- Right : 75
- Bottom : 23
- IsEmpty : False
- PS>$b.Size='50,200'
- PS>$b.Bounds
- Location : {X=0,Y=0}
- Size : {Width=50, Height=200}
- X : 0
- Y : 0
- Width : 50
- Height : 200
- Left : 0
- Top : 0
- Right : 50
- Bottom : 200
- IsEmpty : False
- PS>$b2 = [System.Windows.Forms.Button]::new()
- PS>$b.Location = '30,50'
- PS>compare $b $b2 -Property size,location,text,name
- size : {Width=75, Height=23}
- location : {X=0,Y=0}
- text :
- name :
- SideIndicator : =>
- size : {Width=50, Height=200}
- location : {X=30,Y=50}
- text :
- name :
- SideIndicator : <=
- angelofstealth
- Posts: 69
- Last visit: Wed Sep 28, 2022 10:04 am
Re: GUI: Progress Multiple Com Objects/Progress Bar - Responsive Form
Thanks jvierra, that helps a lot to understand the differences between the controls.
Question:
I am using the Add-tracker to go run a scriptblock which is pulling computer info remotely. If I want to pull from multiple computers should I only use one add-tracker and then in the scriptblock control the foreach computer loop. Or use the foreach loop and call the add-tracker within it to run. I think i should use separate trackers with different Jobs names and then wait for all jobs to complete, update form controls.
Question:
I am using the Add-tracker to go run a scriptblock which is pulling computer info remotely. If I want to pull from multiple computers should I only use one add-tracker and then in the scriptblock control the foreach computer loop. Or use the foreach loop and call the add-tracker within it to run. I think i should use separate trackers with different Jobs names and then wait for all jobs to complete, update form controls.
Re: GUI: Progress Multiple Com Objects/Progress Bar - Responsive Form
The answer to that is completely up to you. It is a design consideration that cannot be made outside of knowing what you are trying to accomplish and what your design criteria are.
- angelofstealth
- Posts: 69
- Last visit: Wed Sep 28, 2022 10:04 am
Re: GUI: Progress Multiple Com Objects/Progress Bar - Responsive Form
What I am trying to understand is if i created a bunch of jobs for the Add-Jobtracker through a loop, how will the form stop from freezing or waiting to update the controls until all the jobs are done. If I use get-job | wait-job after my loop/added trackers, it seems i have a unresponsive form. If I do one computer object with one job i have no issue, want to let you know i do have that working. Understand the multithreading/multi jobs being done without freezing the form. Throwing this out there, don't know, would i use a add-jobtracker to then call on the computer objects loop which will in turn run the multiple job trackers.
Example:
$Computers = (Get-Content C:\Computers.txt)
Foreach ($Computer in $Computers)
{
$rlts = "ComputerInfo-$a"
Add-JobTracker -Name $rlts -JobScript $jobscript -CompletedScript $completedscript -UpdateScript $updatescript -ArgumentList $a, $b
}
Routine/high level:
1) read in a list of computer objects
2) Add to tracker and run script on local computer,
3) After each job completes it update arrays with the values in compeletdscript
4) Once all jobs are done updated datagrids with arrays full of all the data from the jobs.
Example:
$Computers = (Get-Content C:\Computers.txt)
Foreach ($Computer in $Computers)
{
$rlts = "ComputerInfo-$a"
Add-JobTracker -Name $rlts -JobScript $jobscript -CompletedScript $completedscript -UpdateScript $updatescript -ArgumentList $a, $b
}
Routine/high level:
1) read in a list of computer objects
2) Add to tracker and run script on local computer,
3) After each job completes it update arrays with the values in compeletdscript
4) Once all jobs are done updated datagrids with arrays full of all the data from the jobs.
Re: GUI: Progress Multiple Com Objects/Progress Bar - Responsive Form
I can only recommend that JobTracker handles all of your concerns and can manage multiple jobs. Please read the full articles on JobTracker. They do a very good job of explaining how it works and how to use it.
If each script is lengthy then use multiple jobs. If the script is very short then one job. If there are a large number of computers then use multiple jobs.
Also study "Workflow" to see how to parallelize many computers in a single job.
help about_workflows
If each script is lengthy then use multiple jobs. If the script is very short then one job. If there are a large number of computers then use multiple jobs.
Also study "Workflow" to see how to parallelize many computers in a single job.
help about_workflows