List folders at or below a given depth in Powershell
问题 I have a directory which contains a lot of folders. I want to list all folder (path) that go deeper than 2 levels. So in below case folder 1 & 2. Directory/folder1 Directory/folder1/test1/test/testsub Directory/folder1/test2 Directory/folder1/test3 Directory/folder2/blablabla/bla/1 Directory/folder3/test Directory/folder4/test Directory/folder5/test I was trying the following: $Depth = 3 $Path = "." $Levels = "\*" * $Depth $Folder = Get-Item $Path $FolderFullName = $Folder.FullName Resolve