I would like to execute code specific to remote PSSessions. That is, the code is not applied locally, but applies to all remote sessions.
Is there any environment variable, function, or cmdlet that would effectively return true if I am in an active PSSession and false if I run locally?
source share