diff --git a/lib/ansible/plugins/connection/winrm.py b/lib/ansible/plugins/connection/winrm.py index 125e54cb9a..dc41e30483 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 72f2570549..b06a046820 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):