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 7eeb4e0928b..64ea58249ee 100644 --- a/lib/ansible/plugins/shell/powershell.py +++ b/lib/ansible/plugins/shell/powershell.py @@ -30,12 +30,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"): """