Sean,
Welcome to the forum.
When you post code or sample data or console output please format it as code using the preformatted text button ( </> ). Simply place your cursor on an empty line, click the button and paste your code.
Thanks in advance
You may take a look at robocopy. If it’s about copying or moving files and folders in most cases there’s no need for a script.
Regardless of that: What do you want to do with your code? At the moment you’re only listing folders. And for that you don’t need a loop and you don’t need - no, actually you should not use - Write-Host
.