diff --git a/contrib/win32/openssh/OpenSSHUtils.psm1 b/contrib/win32/openssh/OpenSSHUtils.psm1 index a68fd852..a2a52d13 100644 --- a/contrib/win32/openssh/OpenSSHUtils.psm1 +++ b/contrib/win32/openssh/OpenSSHUtils.psm1 @@ -168,7 +168,9 @@ function Repair-AuthorizedKeyPermission $userProfilePath = $properties.ProfileImagePath } $userProfilePath = $userProfilePath.Replace("\", "\\") - $fullPath -match "^$userProfilePath[\\|\W|\w]+authorized_keys$" + if ( $properties.PSChildName -notmatch '\.bak$') { + $fullPath -match "^$userProfilePath\\[\\|\W|\w]+authorized_keys$" + } } if($profileItem) {