From 2aba1c211d402dc14fe074bef5c86df5bf911f38 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 11 Mar 2016 14:00:28 -0500 Subject: [PATCH] Modified files to use single quotes rather than double for file path. Powershell does not process $ variables in strings that are single quoted. Powershell DOES process $ variables that are in double quoted strings. Using single quotes enables ansible to handle file paths that contain folders that start with $. (i.e. C:/Users/$admin/...) --- lib/ansible/plugins/connection/winrm.py | 2 +- lib/ansible/plugins/shell/powershell.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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):