I've tried Title, DisplayTitle, even the ID, but can't find web parts that I know exist in my site. If anybody has a clue, I would appreciate it :)
Already use for the scope the name of the webapp, and URL of the webapp too. How can I give the correct scope for the script?
The code does a foreach on the sites thus creating a SPSite object for reference already. Instead of passing the URL of that object to the next function and the recreating yet another version of the SPSite object from the URL, either pass a reference to the $site or more the sub function code up to the calling function. The creation of SPSite objects is very resource intensive and you'll see a major performance boost by eliminating the excess.