New issue
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
win_acl doesn't work with registry keys #54357
Comments
If I change win_acl.ps1 lines 130-136 to the following, it behaves as expected, but I don't know if this is a better approach than just using
I also opened a bug report in PowerShell here, since I wasn't able to find any references to the problem elsewhere, but I tried it on several different machines and got the same results |
@mhunsber thanks for finding this bug, should have a fix relatively shortly. |
@jborean93 looks good, I tested with the changes in my instance and it worked. |
Thanks for the confirmation, it honestly shouldn't be needed but it's nice to cleanup after yourself and |
SUMMARY
Since the module uses the
LiteralPath
argument for getting and setting the ACL, it does not work for registry keys. This is due to a weird behavior in PowerShell'sGet-Acl
andSet-Acl
cmdlets where you have to be in the drive of the registry key forLiteralPath
to work.In earlier versions of powershell, e.g. PSv2,
LiteralPath
doesn't exist forGet-Acl
andSet-Acl
ISSUE TYPE
COMPONENT NAME
win_acl
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
Windows Server 2012 R2
Windows 10
STEPS TO REPRODUCE
try to use win_acl on a registry key
EXPECTED RESULTS
expected to get "ok" or "changed"
ACTUAL RESULTS
The text was updated successfully, but these errors were encountered: