Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

[PowerShell] - How to use Get-Childitem to only browse two levels down and not a complete tree?

$
0
0

Hi, all.

I need to use PowerShell and I also need it to browse a folder structure, search for subfolders on the 2 or 3 first levels, get those folder name and recreate the same folder structure (But empty).

It was easy to get the first level, using something like this

get-childitem E:\Folder | foreach -process {new-item -path R:\Folder -Name "$_" -ItemType "folder" -Verbose}

But does anyone haw any idea on how to continue browsing down E:\Folder to E:\Folder\Folder\Folder?

/mike

 


MCP, MCDST, MCT, MVP Windows Server - Setup/Deployment

Viewing all articles
Browse latest Browse all 15028

Trending Articles



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