|
|
|
|
@ -499,13 +499,13 @@ def get_powershell_injector_env(
|
|
|
|
|
"""Get the environment variables needed to inject the given PowerShell interpreter into the environment."""
|
|
|
|
|
env = env.copy()
|
|
|
|
|
|
|
|
|
|
if not powershell or not powershell.path:
|
|
|
|
|
if not powershell or not powershell.path or not powershell.version:
|
|
|
|
|
return env # FIXME: how should the absence of pwsh and/or no powershell version specified be handled?
|
|
|
|
|
|
|
|
|
|
powershell_path = get_powershell_path(powershell.path)
|
|
|
|
|
|
|
|
|
|
env['PATH'] = os.path.pathsep.join([powershell_path, env['PATH']])
|
|
|
|
|
env['ANSIBLE_TEST_POWERSHELL_VERSION'] = powershell.version or '' # FIXME: what to do with no version?
|
|
|
|
|
env['ANSIBLE_TEST_POWERSHELL_VERSION'] = powershell.version
|
|
|
|
|
env['ANSIBLE_TEST_POWERSHELL_INTERPRETER'] = powershell.path
|
|
|
|
|
|
|
|
|
|
return env
|
|
|
|
|
|