mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Allow specifying remote powershell version via environment variable.
This commit is contained in:
parent
51a50dee3e
commit
74c43c94cf
1 changed files with 6 additions and 0 deletions
|
@ -24,6 +24,12 @@ import time
|
||||||
|
|
||||||
_common_args = ['PowerShell', '-NoProfile', '-NonInteractive']
|
_common_args = ['PowerShell', '-NoProfile', '-NonInteractive']
|
||||||
|
|
||||||
|
# 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 _escape(value, include_vars=False):
|
def _escape(value, include_vars=False):
|
||||||
'''Return value escaped for use in PowerShell command.'''
|
'''Return value escaped for use in PowerShell command.'''
|
||||||
# http://www.techotopia.com/index.php/Windows_PowerShell_1.0_String_Quoting_and_Escape_Sequences
|
# http://www.techotopia.com/index.php/Windows_PowerShell_1.0_String_Quoting_and_Escape_Sequences
|
||||||
|
|
Loading…
Reference in a new issue