This is for running in a terminal remotely using a ISE like environment where you don't have access to user interaction to run the environment variables once the original script was ran.
This works for environments like CrowdStrike and other tools where remote scripts can be called.