From 9fa758d54c917a587f00a30388ca0ded2b863f51 Mon Sep 17 00:00:00 2001 From: Hans-Joachim Kliemeck Date: Fri, 27 Nov 2015 11:32:54 +0100 Subject: [PATCH] do not move item, instead copy item because acl will be kept --- windows/win_lineinfile.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/windows/win_lineinfile.ps1 b/windows/win_lineinfile.ps1 index 4ba9086a6e9..968f66bae4d 100644 --- a/windows/win_lineinfile.ps1 +++ b/windows/win_lineinfile.ps1 @@ -96,7 +96,8 @@ function WriteLines($outlines, $dest, $linesep, $encodingobj, $validate) { # Commit changes to the destination file $cleandest = $dest.Replace("/", "\"); - Move-Item $temppath $cleandest -force; + Copy-Item $temppath $cleandest -force; + Remove-Item $temppath -force; }