diff --git a/lib/ansible/plugins/connection/winrm.py b/lib/ansible/plugins/connection/winrm.py index 3c079a1f2e2..1fd72f0c940 100644 --- a/lib/ansible/plugins/connection/winrm.py +++ b/lib/ansible/plugins/connection/winrm.py @@ -270,7 +270,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 443e55144df..569df09d449 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):