diff --git a/contents/winrm_session.py b/contents/winrm_session.py index 182c39e..0ea4402 100644 --- a/contents/winrm_session.py +++ b/contents/winrm_session.py @@ -28,6 +28,8 @@ PY2 = sys.version_info[0] == 2 PY3 = sys.version_info[0] == 3 PY34 = sys.version_info[0:2] >= (3, 4) +RD = "RD_" +RD_COMMAND = "RD_EXEC_COMMAND" if PY3: string_types = str, @@ -53,7 +55,7 @@ def run_cmd(self, command, args=(), out_stream=None, err_stream=None): envs = {} for a in os.environ: - if a.startswith('RD_'): + if a.startswith(RD) and a != RD_COMMAND: envs.update({a:os.getenv(a)}) # TODO optimize perf. Do not call open/close shell every time