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