diff --git a/changelogs/fragments/powershell-version-env.yml b/changelogs/fragments/powershell-version-env.yml new file mode 100644 index 00000000000..d1de77e99ea --- /dev/null +++ b/changelogs/fragments/powershell-version-env.yml @@ -0,0 +1,2 @@ +bugfixes: +- powershell - remove getting the PowerShell version from the env var ``POWERSHELL_VERSION``. This feature never worked properly and can cause conflicts with other libraries that use this var diff --git a/lib/ansible/plugins/shell/powershell.py b/lib/ansible/plugins/shell/powershell.py index 56c270f383f..4afd4f32f42 100644 --- a/lib/ansible/plugins/shell/powershell.py +++ b/lib/ansible/plugins/shell/powershell.py @@ -31,12 +31,6 @@ from ansible.plugins.shell import ShellBase _common_args = ['PowerShell', '-NoProfile', '-NonInteractive', '-ExecutionPolicy', 'Unrestricted'] -# Primarily for testing, allow explicitly specifying PowerShell version via -# an environment variable. -_powershell_version = os.environ.get('POWERSHELL_VERSION', None) -if _powershell_version: - _common_args = ['PowerShell', '-Version', _powershell_version] + _common_args[1:] - def _parse_clixml(data, stream="Error"): """