API Reference
Command
Set-CxFilePermissions
Sets file or directory permissions (DACL).
Examples
Example 1
# Replace with SDDL
Set-CxFilePermissions -Path 'C:\\Data' -Sddl 'D:(A;;FA;;;S-1-5-32-544)'
Example 2
# Merge typed entries into existing DACL
$e = [ComputerX.Acl.FileAclEntry]@{ IdentityName='BUILTIN\\Users'; Rights=[System.Security.AccessControl.FileSystemRights]::ReadAndExecute; AccessType='Allow' }
Set-CxFilePermissions -Path 'C:\\Data' -Entries $e -Ensure Merge
Common Parameters
This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.
For more information, see about_CommonParameters.
Syntax
Set-CxFilePermissions -Path <string> -Sddl <string> [-Ensure <Replace|Merge>] [<CommonParameters>]#Parameter set:
By SddlParameters
- Path string
- File system path to the target resource.
- Sddl string
- Gets or sets the Sddl parameter.
- Ensure EnsureMode
- Gets or sets the Ensure parameter. Possible values: Replace, Merge
- Possible values:
Replace,Merge
Outputs
System.Boolean
Set-CxFilePermissions -Path <string> -Entries <FileAclEntry[]> [-Ensure <Replace|Merge>] [<CommonParameters>]#Parameter set:
By EntriesParameters
- Path string
- File system path to the target resource.
- Entries FileAclEntry[]
- Typed ACL entries to apply when not supplying SDDL.
- Ensure EnsureMode
- Gets or sets the Ensure parameter. Possible values: Replace, Merge
- Possible values:
Replace,Merge
Outputs
System.Boolean