Advertisement
Guest User

Untitled

a guest
Feb 8th, 2016
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. Function GetFiles($folder)
  2. {
  3. Write-Host "+"$folder.Name
  4. foreach($file in $folder.Files)
  5. {
  6. Write-Host "`t" $file.Name
  7. }
  8.  
  9. # Use recursion to loop through all subfolders.
  10. foreach ($subFolder in $folder.SubFolders)
  11. {
  12. Write-Host "`t" -NoNewline
  13. GetFiles($Subfolder)
  14. }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement