If it doesn;t work try this:
$folder = "d:\test"
$access=[System.Security.AccessControl.AccessControlType]::Allow
$rights = [System.Security.AccessControl.FileSystemRights]"FullControl,Read,Write"
$inherit = [System.Security.AccessControl.InheritanceFlags]"ContainerInherit,ObjectInherit"
$propagate = [System.Security.AccessControl.PropagationFlags]::InheritOnly
$ace = New-Object System.Security.AccessControl.FileSystemAccessRule("NT AUTHORITY\SYSTEM",$rights,$inherit,$propagate,$access)
$acl = Get-Acl $folder
$acl.AddAccessRule($ace)
$acl.SetAccessRuleProtection($false,$false)
Set-Acl $folder $acl
Check this article too:
http://www.microsoft.com/technet/sc...p0516.mspx