From 45a32137ada50544c82475dc4ccbee7df4548762 Mon Sep 17 00:00:00 2001 From: Andrea Scarpino Date: Sun, 20 Mar 2016 12:29:26 +0100 Subject: [PATCH] win_unzip: Use absolute path for src and dest win_unzip fails to extract files when either src or dest contains complex paths such as "..\..\" or "C:\\Program Files" (double slashes). Fix this by fetching absolute path of both before invoking CopyHere method. --- lib/ansible/modules/extras/windows/win_unzip.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/extras/windows/win_unzip.ps1 b/lib/ansible/modules/extras/windows/win_unzip.ps1 index f547c0081fa..59fbd33166c 100644 --- a/lib/ansible/modules/extras/windows/win_unzip.ps1 +++ b/lib/ansible/modules/extras/windows/win_unzip.ps1 @@ -59,8 +59,8 @@ $rm = ConvertTo-Bool (Get-AnsibleParam -obj $params -name "rm" -default "false") If ($ext -eq ".zip" -And $recurse -eq $false) { Try { $shell = New-Object -ComObject Shell.Application - $zipPkg = $shell.NameSpace($src) - $destPath = $shell.NameSpace($dest) + $zipPkg = $shell.NameSpace([IO.Path]::GetFullPath($src)) + $destPath = $shell.NameSpace([IO.Path]::GetFullPath($dest)) # 20 means do not display any dialog (4) and overwrite any file (16) $destPath.CopyHere($zipPkg.Items(), 20) $result.changed = $true