Hi there,
This will print out all folder names of a document library:
Add-PSSnapin Microsoft.SharePoint.Powershell -ErrorAction SilentlyContinue
$web = Get-SPWeb 'http://urltoyourwebsite'
$list = $web.Lists['DocumentLibrary']
function ListFolders($folder) {
Write-Host $folder.Name
$folder.Subfolders | % { if( $.item -ne $null) { ListFolders $}}
}
ListFolders $list.RootFolder
I hope this information helps. If you have any questions please let me know and I will be glad to help you out.
------------------------------------------------------------------------------------------------------------------------------------
--If the reply is helpful, please Upvote and Accept it as an answer--