win_copy: Add missing check_mode fix (#31469)
* Add missing check_mode fix
* Refactor conditional to use the one embedded in Remove-Item
(cherry picked from commit 5bf9f271b3
)
This commit is contained in:
parent
7f2c611dfc
commit
fe4eedf5b6
1 changed files with 1 additions and 1 deletions
|
@ -76,7 +76,7 @@ Function Copy-File($source, $dest) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Test-Path -Path $dest -PathType Leaf) {
|
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"
|
$diff += "-$dest`n"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue