What exactly are you trying to do? The file has to have an owner. You can change or set the owner, but that is not the way to do it. Set-ACL is expecting a PSObject formatted with required information and you are removing it. I would recommend reading the help files on Set-ACL for examples and researching the internet for examples.
$ACL = Get-Acl -Path $Path
$AccessRights = $ACL.Access
# make changes to $accessrights by adding, removing, or altering the FileSystemAccessRules
Set-Acl -Path $Path -AclObject $AccessRights
I found this way. Joel, I got an invalid argument error. I think you mean “-aclobject $acl”.
# this works
# path, owner, and group properties are null
$acl = (Get-Item c:\users\user1\foo.txt).GetAccessControl('Access')
$acl | set-acl c:\users\user2\foo.txt
I tried “$acl.owner = $null”, but the property is ReadOnly. I think the input object has to be a certain type.