Get-ChildItem list txt file and more!

Ask your PowerShell-related questions, including questions on cmdlet development!
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.
This topic is 6 years and 3 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Get-ChildItem list txt file and more!

Post by jvierra »

So you really were asking how to open the item and not how to run the item in Explorer. Two completely different things.

Here is a demo of how to correctly manage items in a DGV.
Attachments
Demo-DGVClick2.psf
(19.41 KiB) Downloaded 133 times
User avatar
apowershelluser
Posts: 190
Last visit: Mon Mar 18, 2024 7:13 pm
Answers: 1

Re: Get-ChildItem list txt file and more!

Post by apowershelluser »

Hmm, not sure where I said 'run'. I do remember this is what I said viewtopic.php?f=18&t=12095#p65297

Anyway, Wow! So little code and so much happening.
I have to incorporate this into a Job and replace the textbox with a drop down of my servers, add some combo-boxes and I'll have something wrapped up.

Something like this ( I clearly need to incorporate more of your code but this is what I'd like my GUI to look like):

My idea being they select the server from the combobox, click the Query button adds to a variable ($files from your script), which will display every folder in the directory in the DGV

Use the radoiobuttons to query again what I need based off the files names of:
Capture Completed with Errors = Failed
Capture Completed with Success = Captures
Capture Syncing = Pending

Viola, the DGV is populated as needed for high level with a mouse double click to open the folder ( invoke-item) - remember my original post, this is exactly what I wanted
2nd Phase - second column using a select string to see why it failed in a \Logs folder

Thanks for all of your help so far!
Attachments
DGV5.psf
(77.94 KiB) Downloaded 111 times
User avatar
apowershelluser
Posts: 190
Last visit: Mon Mar 18, 2024 7:13 pm
Answers: 1

Re: Get-ChildItem list txt file and more!

Post by apowershelluser »

Is this the correct way to use multiple jobs in PowerShell Studio?

it's running correctly, I just wanted to make sure I'm not missing something.

JobName does the get-childitem to list all of the files
JobNameTotalCount - gets the total amount of folders on the server
JobNameTotalFailures - gets the total count of failures based on this script

Get-ChildItem \\server\users\*\ |
ForEach-Object{
Get-ChildItem $_ -File |
Where-Object {($_.fullname -match "Cycle Completed with Errors")} | select FullName

}
Attachments
MultipleJobs.png
MultipleJobs.png (18.81 KiB) Viewed 2453 times
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Get-ChildItem list txt file and more!

Post by jvierra »

Is it doing what you want? Are the jobs running? Not sure why you are asking this.
User avatar
apowershelluser
Posts: 190
Last visit: Mon Mar 18, 2024 7:13 pm
Answers: 1

Re: Get-ChildItem list txt file and more!

Post by apowershelluser »

I just want to make sure there wasn't a different way to add jobs. This is a new realm for me in terms of Jobs
This topic is 6 years and 3 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked