I still cannot figure out what you are trying to do here.
If you use Test-Path it will tell you if a folder is valid and it is fast. What all of the rest is for makes little sense.
Why use a workflow or job when you just want to test a number of folder paths??? Test-Path is nearly instantaneous.
Invoke-Item with Jobs
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.
- StillLearning
- Posts: 39
- Last visit: Tue Apr 10, 2018 9:39 pm
Re: Invoke-Item with Jobs
Let’s start over.
I’m attempting to make a button to open an explorer window. This folder is the backup of a users data.
I know the username but I don’t know which server it resides on.
I’d like to loop through my list of servers in a txt file and find the users folder
I also don’t want it to freeze my form.
Workflow in a job would be the wiset solution to my problem I believe.
I’m attempting to make a button to open an explorer window. This folder is the backup of a users data.
I know the username but I don’t know which server it resides on.
I’d like to loop through my list of servers in a txt file and find the users folder
I also don’t want it to freeze my form.
Workflow in a job would be the wiset solution to my problem I believe.
Last edited by StillLearning on Tue Mar 13, 2018 9:40 pm, edited 1 time in total.
- StillLearning
- Posts: 39
- Last visit: Tue Apr 10, 2018 9:39 pm
Re: Invoke-Item with Jobs
I want to view the folder contents so I can check for errors hence my invoke-item
The errors are easier to identify browsing the folder due to no error logging from our data capture application.
The errors are easier to identify browsing the folder due to no error logging from our data capture application.
- StillLearning
- Posts: 39
- Last visit: Tue Apr 10, 2018 9:39 pm
Re: Invoke-Item with Jobs
Good morning!
It’s not the files I want to open but the users folder in explorer
\\server13\datacapture\jvierra
This is why I have to do a test-path in a foreach loop
It’s not the files I want to open but the users folder in explorer
\\server13\datacapture\jvierra
This is why I have to do a test-path in a foreach loop
- StillLearning
- Posts: 39
- Last visit: Tue Apr 10, 2018 9:39 pm
Re: Invoke-Item with Jobs
Yes! We’re now on the same page. Earlier you asked why I did that and it had me confused as it made me think I was doing it incorrectly.
So now, is there a way to stop the job when it finds the folder? I’ll obviously have to figure how to do something in the complete section of the job tracker, maybe by finding the new process?
So now, is there a way to stop the job when it finds the folder? I’ll obviously have to figure how to do something in the complete section of the job tracker, maybe by finding the new process?
Re: Invoke-Item with Jobs
Stopping a workflow job is not possible due to timing. It will not stop fast enough to get only one.
You need to change your design. Return the folders that are found as they are found. Use the UpdateScript to open the first one returned and ignore all others.
You could use the update to fill a listbox with the results and use the listbox event to open the first insert and ignore all other inserts.
Many ways to do this but you cannot open explorer from the job.
You need to change your design. Return the folders that are found as they are found. Use the UpdateScript to open the first one returned and ignore all others.
You could use the update to fill a listbox with the results and use the listbox event to open the first insert and ignore all other inserts.
Many ways to do this but you cannot open explorer from the job.