From 5bf9f271b353d8156095104faa688b70898fdcbe Mon Sep 17 00:00:00 2001 From: Vyronas Tsingaras Date: Mon, 9 Oct 2017 21:37:33 +0300 Subject: [PATCH] win_copy: Add missing check_mode fix (#31469) * Add missing check_mode fix * Refactor conditional to use the one embedded in Remove-Item --- lib/ansible/modules/windows/win_copy.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/modules/windows/win_copy.ps1 b/lib/ansible/modules/windows/win_copy.ps1 index 26b4c76a398..2af02105fe3 100644 --- a/lib/ansible/modules/windows/win_copy.ps1 +++ b/lib/ansible/modules/windows/win_copy.ps1 @@ -76,7 +76,7 @@ Function Copy-File($source, $dest) { } if (Test-Path -Path $dest -PathType Leaf) { - Remove-Item -Path $dest -Force -Recurse | Out-Null + Remove-Item -Path $dest -Force -Recurse -WhatIf:$check_mode | Out-Null $diff += "-$dest`n" }