Ansible 2.0 parameter escaping problem

I’ve starting seeing the following problem since I upgraded to Ansible v2.0

Here’s the task:

`

raw:

PowerShell “C:\Temp\db_scripts\copy_db_file.ps1” "{{ system_db_default_location }}/master.mdf" "{{ system_db_master_mdf_location }}/master.mdf"

`

It used to work fine in Ansible 1.9 but now I get a PowerShell error:

“stderr”: “The string is missing the terminator: ".\r\n + CategoryInfo : ParserError: (:slight_smile: , ParentContainsErrorRecordEx \r\n ception\r\n + FullyQualifiedErrorId : TerminatorExpectedAtEndOfString\r\n \r\n”

This is obviously something to do with the way Ansible has changed how it handles escaped characters but I’ve tried a number of other different options for escaping my task and i can’t get it to work.

I appreciate any suggestions.

After much base64 decoding of Powershell commands the following will work:

raw:

C:\Temp\db_scripts\copy_db_file.ps1 “{{ system_db_default_location }}/master.mdf” “{{ system_db_master_mdf_location }}/master.mdf”

I removed the PowerShell call at the beginning, unquoted the script path and then removed the escaping slash \ before the quotation marks around the arguments.

Hopefully this will help somebody!