So this post will be extremely short, but hopefully useful. The below script is a good starting point if you have a repetitive task that you need to complete on all of your sub sites within a particular site collection. This script will loop through all of the sub sites, including sub sites of sub sites and print out the site's title and URL. To use the script you simply need to run the script and input the site’s root URL without quotes. So if my site collection was http://danssandbox.com/sites/dansSand , I would simply need to input that URL when prompted by the script for the “Root Site Collection Path.”
This script is meant as a starting point to include actual logic rather than the Write-Hosts, but it should get you on the right track! Enjoy the loops!