Take the 2-minute tour ×  I have a very simple powershell script
that has a different behaviour depending on if I execute the
script locally or remotely through a Invoke-Command / Enter-
PSSession . Other scripts work fine. I'm wondering what is
different about the environment of a remote session vs. a local
session that would cause this difference.  share|improve this
question  1 Answer 1  up vote 2 down vote accepted  Assuming the
remote endpoint is set up to use your credentials, the remote
session may have a different set of modules available (or
different versions), there may be a profile script configured to
run for the remote session and the environment is likely to be
different. Also note that remote endpoints can be configured to
limit access to commands (including applications) as well as
restrict the language mode. A script could also walk various
variables and functions to limit their visibility as well. If
you look at session state you can see some of the properties
that can be tweaked when config