diff --git a/lib/ansible/plugins/connection/winrm.py b/lib/ansible/plugins/connection/winrm.py index 125e54cb9aa..dc41e304836 100644 --- a/lib/ansible/plugins/connection/winrm.py +++ b/lib/ansible/plugins/connection/winrm.py @@ -274,7 +274,7 @@ class Connection(ConnectionBase): script_template = u''' begin {{ - $path = "{0}" + $path = '{0}' $DebugPreference = "Continue" $ErrorActionPreference = "Stop" diff --git a/lib/ansible/plugins/shell/powershell.py b/lib/ansible/plugins/shell/powershell.py index 72f2570549f..b06a0468201 100644 --- a/lib/ansible/plugins/shell/powershell.py +++ b/lib/ansible/plugins/shell/powershell.py @@ -52,7 +52,7 @@ class ShellModule(object): path = '\\'.join(parts) if path.startswith('~'): return path - return '"%s"' % path + return '\'%s\'' % path # powershell requires that script files end with .ps1 def get_remote_filename(self, base_name):