Files
PowerShell/test/powershell/Modules/Microsoft.PowerShell.Security/AclCmdlets.Tests.ps1
T
James Truher 9d1c998287 Filling test gaps (issue 2022) - this replaces PR 1834
This replaces PR 1834 from the private fork I had
2016-08-22 14:56:04 -07:00

19 lines
988 B
PowerShell

Describe "Acl cmdlets are available and operate properly" -Tag CI {
It "Get-Acl returns an ACL object" -pending:(!$IsWindows) {
$ACL = get-acl $TESTDRIVE
$ACL.gettype().FullName | Should be "System.Security.AccessControl.DirectorySecurity"
}
It "Set-Acl can set the ACL of a directory" -pending {
Setup -d testdir
$directory = "$TESTDRIVE/testdir"
$acl = get-acl $directory
$accessRule = [System.Security.AccessControl.FileSystemAccessRule]::New("Everyone","FullControl","ContainerInherit,ObjectInherit","None","Allow")
$acl.AddAccessRule($accessRule)
{ $acl | Set-Acl $directory } | should not throw
$newacl = get-acl $directory
$newrule = $newacl.Access | ?{ $accessrule.FileSystemRights -eq $_.FileSystemRights -and $accessrule.AccessControlType -eq $_.AccessControlType -and $accessrule.IdentityReference -eq $_.IdentityReference }
$newrule |Should not benullorempty
}
}