Get-ChildItem list txt file and more!

Ask your Windows 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.
User avatar
jvierra
Posts: 12399
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: Get-ChildItem list txt file and more!

Post by jvierra » Mon Nov 27, 2017 3:51 pm

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 14 times

User avatar
JohnTitor
Posts: 55
Joined: Fri Nov 17, 2017 8:49 pm

Re: Get-ChildItem list txt file and more!

Post by JohnTitor » Mon Nov 27, 2017 8:01 pm

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 10 times

User avatar
JohnTitor
Posts: 55
Joined: Fri Nov 17, 2017 8:49 pm

Re: Get-ChildItem list txt file and more!

Post by JohnTitor » Tue Nov 28, 2017 11:19 am

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 513 times

User avatar
jvierra
Posts: 12399
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: Get-ChildItem list txt file and more!

Post by jvierra » Tue Nov 28, 2017 11:37 am

Is it doing what you want? Are the jobs running? Not sure why you are asking this.

User avatar
JohnTitor
Posts: 55
Joined: Fri Nov 17, 2017 8:49 pm

Re: Get-ChildItem list txt file and more!

Post by JohnTitor » Tue Nov 28, 2017 11:48 am

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

Locked