Update ACL check to use identifier to prevent localization errors

This commit is contained in:
Chris Roberts 2018-07-06 16:25:05 -07:00
parent 04f7215b5e
commit 15dacc80c0
1 changed files with 5 additions and 1 deletions

View File

@ -709,7 +709,11 @@ function Check-VagrantHyperVAccess {
[string] $Path [string] $Path
) )
$acl = Get-ACL -Path $Path $acl = Get-ACL -Path $Path
$systemACL = $acl.Access | where {$_.IdentityReference -eq "NT AUTHORITY\System" -and $_.FileSystemRights -eq "FullControl" -and $_.AccessControlType -eq "Allow" -and $_.IsInherited -eq $true} $systemACL = $acl.Access | where {
$_.IdentityReference.Translate([System.Security.Principal.SecurityIdentifier]).Value -eq "S-1-5-18" -and
$_.FileSystemRights -eq "FullControl" -and
$_.AccessControlType -eq "Allow" -and
$_.IsInherited -eq $true}
if($systemACL) { if($systemACL) {
return $true return $true
} }