We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This trick does not work with PS7. The API has changed between .Net 4.x and .net core.
https://github.com/dsccommunity/FileSystemDsc/blob/master/source/DSCResources/DSC_FileSystemAccessRule/DSC_FileSystemAccessRule.psm1#L611
I think the below should work (ok in PS7):
function Get-ACLAccess { [CmdletBinding()] param ( [Parameter(Mandatory = $true)] [System.String] $Path ) $EmptyAcl = [System.Security.AccessControl.DirectorySecurity]::new() $ACL = (Get-Acl -Path $Path) $ACL.Access.Foreach{$EmptyAcl.Access.AddRule($_)} return $ACL }
Here's how I tested:
$FileSystemAccessRuleProperties = @{ Path = 'C:\src\testACL' Identity = 'AzureAD\GaelColas' Rights = @('FullControl') } $invokeDscResourceParams = @{ Name = 'FileSystemAccessRule' ModuleName = 'FileSystemDsc' Property = $FileSystemAccessRuleProperties } if (-not (Invoke-DscResource @invokeDscResourceParams -Method Test).InDesiredState ){ Invoke-DscResource @invokeDscResourceParams -Method Set -Verbose } Invoke-DscResource @invokeDscResourceParams -Method Test
The text was updated successfully, but these errors were encountered:
No branches or pull requests
This trick does not work with PS7.
The API has changed between .Net 4.x and .net core.
https://github.com/dsccommunity/FileSystemDsc/blob/master/source/DSCResources/DSC_FileSystemAccessRule/DSC_FileSystemAccessRule.psm1#L611
I think the below should work (ok in PS7):
Here's how I tested:
The text was updated successfully, but these errors were encountered: