set-acl
Change the security descriptor of a specified item, such as a file or a registry key. tldr-pages
On Windows
Windows
Change the security descriptor of a specified item, such as a file or a registry key. Note: This command can only be used through PowerShell.
Copy a security descriptor from one file to another
$OriginAcl = Get-Acl -Path path\to\file; Set-Acl -Path path\to\file -AclObject $OriginAclIdentifyTrips 1 Sigma rule: highPowerShell Script Change Permission Via Set-Acl by Nasreddine Bencherchali (Nextron Systems)
Use the pipeline operator to pass a descriptor
Get-Acl -Path path\to\file | Set-Acl -Path path\to\fileIdentify