I want to pass a variable back to a task sequence from a script. This script is in a package, and could be run as an advert or from the TS. If I try to enable Microsoft.SMS.TSEnvironment and I'm not in a TS, it will generate an error.
Is there a way I can KNOW that I'm in a TS prior to doing so?