1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

tkuratomi bugfix for BOMs in powershell modules

fixes #15998
This commit is contained in:
nitzmahone 2016-07-11 11:51:28 -07:00
parent 0a439df4b0
commit 31e963dd2a

View file

@ -674,6 +674,12 @@ def _find_snippet_imports(module_name, module_data, module_path, module_args, ta
module_args_json = to_bytes(json.dumps(module_args)) module_args_json = to_bytes(json.dumps(module_args))
module_data = module_data.replace(REPLACER_JSONARGS, module_args_json) module_data = module_data.replace(REPLACER_JSONARGS, module_args_json)
# Powershell/winrm don't actually make use of shebang so we can
# safely set this here. If we let the fallback code handle this
# it can fail in the presence of the UTF8 BOM commonly added by
# Windows text editors
shebang = u'#!powershell'
# Sanity check from 1.x days. This is currently useless as we only # Sanity check from 1.x days. This is currently useless as we only
# get here if we are going to substitute powershell.ps1 into the # get here if we are going to substitute powershell.ps1 into the
# module anyway. Leaving it for when/if we add other powershell # module anyway. Leaving it for when/if we add other powershell