Hello,
I found this script online that's been working great for me if not in a job (ISE and or just a normal button click event). Once I try to insert the code into a Button-Start Job control set, it returns no results.
Jobs and DGV
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.
- mxtrinidad
- Posts: 399
- Last visit: Tue May 16, 2023 6:52 am
Re: Jobs and DGV
Rule of thumb here is.. If it works in the console then you can use the same block of code in the JobTracker function with little or no changes.
In your case, splitting the code is not working, also I won't recommend using the same Variable name with the parameters.
Also, the use of '-ArgumentList' parameter are meant to pass single string and not arrays values.
Attached is a modified form for ping only. You can make the necessary changes.
In your case, splitting the code is not working, also I won't recommend using the same Variable name with the parameters.
Also, the use of '-ArgumentList' parameter are meant to pass single string and not arrays values.
Attached is a modified form for ping only. You can make the necessary changes.
- mxtrinidad
- Posts: 399
- Last visit: Tue May 16, 2023 6:52 am
Re: Jobs and DGV
My Apology and Good news!!
I figured out the changes needed for your script to work. Only two changes required:
1. In the "-UpdateScript' parameter, comment out the next line as is not really needed.
2. In the '-ArgumentList' parameter, need to have an open/close parenthesis:
That's it!! The rest of your code should work fine.
Please let us know if these changes works for you.
I figured out the changes needed for your script to work. Only two changes required:
1. In the "-UpdateScript' parameter, comment out the next line as is not really needed.
Code: Select all
#$results = Receive-Job -Job $Job;
Code: Select all
-ArgumentList ($Computers, $SUFFIXES)
Please let us know if these changes works for you.
- MarvelManiac
- Posts: 63
- Last visit: Thu Sep 13, 2018 3:40 pm
Re: Jobs and DGV
Thanks, I'll give this a try tonight.
One thing that comes to mind. I've seen that the ISE does not react the sameway as the console. Is there truth to this? I write 100% of my scripts in the ISE, then transfer them to PSS
One thing that comes to mind. I've seen that the ISE does not react the sameway as the console. Is there truth to this? I write 100% of my scripts in the ISE, then transfer them to PSS
- mxtrinidad
- Posts: 399
- Last visit: Tue May 16, 2023 6:52 am
Re: Jobs and DGV
Good! Just keep in mind. ISE PowerShell host is not the same the SAPIEN PowerShell host as we build our own for our product.
Just let us know how you did with the script.
Just let us know how you did with the script.
Re: Jobs and DGV
Here is a basic demo of how to dynamically update a DGV from a job tracker. It is really very easy to set up and use. As each result is received it is added to the DGV.
I also have a few other examples that are more complex but are designed to work with a SQLServer database.
I also have a few other examples that are more complex but are designed to work with a SQLServer database.
- Attachments
-
- JobPingTest.psf
- (35.45 KiB) Downloaded 153 times
- MarvelManiac
- Posts: 63
- Last visit: Thu Sep 13, 2018 3:40 pm
Re: Jobs and DGV
Hello, I did want to provide an update as I'm still trying to understand why you guys are doing it two separate but similar ways.
I have noticed these run different on Windows 7 vs Windows 10.
For example, under Windows 10 it takes a few moments to start and by then I'm able to ping 60 or so machines
The progress bar will be complete but it's still finding PCs
Or Windows 10 will run very smooth and Windows 7 will throw 100's of errors
I have noticed these run different on Windows 7 vs Windows 10.
For example, under Windows 10 it takes a few moments to start and by then I'm able to ping 60 or so machines
The progress bar will be complete but it's still finding PCs
Or Windows 10 will run very smooth and Windows 7 will throw 100's of errors
Re: Jobs and DGV
You have to look at my example carefully to understand why it works. It will work on any system. I have updated it due to one item that reported the wrong status. Run it with the array defined then add a couple of your systems.
Before moving on or making any changes you need to understand HOW it works.
Before moving on or making any changes you need to understand HOW it works.
- Attachments
-
- JobPingTest.psf
- (23.53 KiB) Downloaded 119 times