From 3c33618cf6f5f63930be19c9adf5eaa5fe1a9945 Mon Sep 17 00:00:00 2001 From: Jordan Borean Date: Wed, 30 Sep 2020 06:24:31 +1000 Subject: [PATCH] powershell - remove env var (#72010) --- changelogs/fragments/powershell-version-env.yml | 2 ++ lib/ansible/plugins/shell/powershell.py | 6 ------ 2 files changed, 2 insertions(+), 6 deletions(-) create mode 100644 changelogs/fragments/powershell-version-env.yml 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"): """