Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 366
  • Last Modified:

Need sub folder path details in the text file -Urgent

There many sub folders and i'm just interested in specific folder and it's sub folder details
Example

Root folder
   - folder1
         -sub-folder 1
                   -interested
                             - Sub folder 1
                             -Sub folder 2
          - Interested
     -Interested
     -Folder2
      -Folder3
     
Now i need "interested "folder and it's sub-folder path details in a text file. How to find it?
0
VIVEKANANDHAN_PERIASAMY
Asked:
VIVEKANANDHAN_PERIASAMY
  • 2
1 Solution
 
Ram BalachandranCommented:
This is not a complete solution
PS C:\> Get-ChildItem -Recurse -include users | ?{ $_.PSIsContainer } | Select-O
bject FullName

Open in new window

0
 
VIVEKANANDHAN_PERIASAMYAuthor Commented:
This we give only the folder path with interested.It's doesn't give sub folder details.
I manily looking to get the sub folder details.
0
 
VIVEKANANDHAN_PERIASAMYAuthor Commented:
Any help is much appreciated.
0
 
QlemoBatchelor, Developer and EE Topic AdvisorCommented:
What exactly do you need as "sub folder details"? I take it you mean more than just the paths, because that would be too simple (and ram_kerala's code is a good start):
Get-ChildItem -Recurse C:\ -include Interested | ? { $_.PsIsContainer } |
  Get-ChildItem -Recurse | ? { $_.PsIsContainer }

Open in new window

or, maybe faster
Get-ChildItem -Recurse C:\ |
   ? { $_.FullName -like '*\Interested\*' } |
   ? { $_.PsIsContainer } | select FullName

Open in new window

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now