Fix win_git module for hidden folders

This commit is contained in:
Kenneth Benzie 2023-10-06 10:51:03 +01:00
parent 9fef9403b3
commit 0d1993ef53

View File

@ -223,7 +223,7 @@ if ($recursive) {
# Ensure the repository has the correct owner # Ensure the repository has the correct owner
$userName = [System.Security.Principal.WindowsIdentity]::GetCurrent().Name $userName = [System.Security.Principal.WindowsIdentity]::GetCurrent().Name
$idRef = [System.Security.Principal.NTAccount]::new($userName) $idRef = [System.Security.Principal.NTAccount]::new($userName)
Get-Item $dest | foreach { ` Get-Item -Force $dest | foreach { `
$_ ; $_ | Get-ChildItem -Force -Recurse ` $_ ; $_ | Get-ChildItem -Force -Recurse `
} | foreach { ` } | foreach { `
$acl = $_ | Get-Acl; $acl.SetOwner($idRef); $_ | Set-Acl -AclObject $acl ` $acl = $_ | Get-Acl; $acl.SetOwner($idRef); $_ | Set-Acl -AclObject $acl `