The main reason for not liking the use of globals is because they're usually always never necessary, and if you are, you have fundamental architectural issues in whatever you're doing.
For instance, with the below:
Why do they need to be global at all? They'll be accessible throughout your entire script without globally scoping as child scopes can access variables in parent scopes. None of the environment variables we export are global and no one's reported an issue. See? Not necessary
By the way, if those variables are of legitimate use to anyone, there's no problem adding them into the toolkit either. We haven't shipped 4.2.0 yet, nothing's too late.
It's because you're trying to reference values within $adtSession before the object is even created. I only it was in an example above but it's not correct and the error should have been fairly explicit about the issue.
I haven't yet had time to make the shift to the new 4.x version of PSADT so maybe I'm missing something obvious here but OP says he's doing this in PSADT v3.8.4. Searching my PSADT archives, the variable "$adtSession" does not exist in v3.8.4 (or any of the old versions I have).
It's true, I'm currently still using version 3.8.4, but I want to switch to version 4.1.8. The variables are from the old version and I'd like to integrate them into the new version.
With your adjustments to $adtsession, the script runs without errors again, but it still doesn't seem to find the path. I created a test folder under System Profile x64. When I try to delete it using the variable, nothing happens.