Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

list all items of ALL subfolders within subfolders

$
0
0

Hi,

I'm trying to find a way of looping through all items and sub-items in  a folder and list them.

for example:

Get-ChildItem -path c:\test

now lets say c:\test has 2 folders in it.

test_2

test_3

and lets say that c:\test\test_2

has a folder in it.. c:\test\test_2\items444\

so I want to get a list of all files *.* in all the folders and subfolders and sub-sub-folders etc...

actually I don't even know how deep the path will go, so maybe I need a loop that will check if there's a PSIsContainer and if that's true grab it's content and so on...

thanks in advance!


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>