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

How to get a list of folders and subfolders from a network share?

$
0
0

Hi,

I am using the powershell code below to get a list of folders and subfolders from a share. This is just showing the foldername. Is there a way to show the full path? ie\\Server\Share\Folder...

I would like to go 1 level deep and have output similiar to this?
\\Server\Share1\Folder1
\\Server\Share1\Folder2
\\Server\Share2\Folder1
\\Server\Share2\Folder2

Can this be modified to accomplish this?

    Get-ChildItem \\Server\Share| Where { $_.PSIsContainer } | Foreach  {Get-Childitem $_.FullName}  | Where { $_.PSIsContainer } | Select-Object name


Viewing all articles
Browse latest Browse all 21975

Trending Articles



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