![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | how to show the name of child item after its in the pipeline? hi list; i am using the following to search status reports and extract hours estimates get-childitem |get-content |where-object{$_ -match "hours"} works great because it saves a ton of work, but what i'd really like is to be able to take the name of the chiditem piped and expose its name at the start of the line, so it should look like filename1 estimated hours 40-60 filename2 estimated hours 35-50 filenameN estimated hours ddd-ddd but sticking anything between get-childitem and get-content ain't gettin it. thanks very much for your help |
My System Specs![]() |
| | #2 (permalink) |
| | Re: how to show the name of child item after its in the pipeline? Select-String returns Microsoft.PowerShell.Commands.MatchInfo object -unless the -List switch is present. Its output by default shows the Microsoft.PowerShell.Commands.MatchInfo's Filename, LineNumber and Line properties: # pipe the items to its Path parameter by Property Name # and a RegEx to its Pattern parameter positionally ls | select-string hours # if you don't want the line number ls | select-string hours | % {$_.filename + ':' + $_.line} This Cmdlet performs great... -- Kiron |
My System Specs![]() |
| | #3 (permalink) |
| | Re: how to show the name of child item after its in the pipeline? # oops -unless the -List switch is present. # should be... -unless the -Quiet switch is present. -- Kiron |
My System Specs![]() |
| | #4 (permalink) |
| | Re: how to show the name of child item after its in the pipeline? this powershell stuff makes me feel kinda dizzy and my mouth get dry... thanks a ton Kiron. drew "Kiron" wrote: Quote: > # oops > -unless the -List switch is present. > > # should be... > -unless the -Quiet switch is present. > > -- > Kiron |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Copy-Item : Container cannot be copied onto existing leaf item. | PowerShell | |||
| How to iterate through child items in pipeline | PowerShell | |||
| Pipeline input problems using Get-ChildItem and Invoke-Item | PowerShell | |||
| Menu Item Icon shows in the IDE but does not show when app is runn | .NET General | |||
| get-child item question from a newbie | PowerShell | |||