Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 361
  • 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
 
QlemoC++ DeveloperCommented:
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

Featured Post

Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

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