I have tried How To Manage File System ACLs With PowerShell
link
http://www.tomsitpro.com/articles/powershell-manage-file-system-acl,2-837.html
I am unable to get the last part to run any help will be appreciated
http://www.tomsitpro.com/articles/powershell-manage-file-system-acl,2-837.html
First part
((Get-Item c:\test).GetAccessControl(
'Access'))
.Access
Second part
[PS] C:\Windows\system32>((Get-
ChildItem c:\test -Directory).GetAccessContr
ol('Access
')).Access
Get-ChildItem : A parameter cannot be found that matches parameter name 'Directory'.
At line:1 char:35
+ ((Get-ChildItem c:\test -Directory <<<< ).GetAccessControl('Access
')).Access
+ CategoryInfo : InvalidArgument: (:) [Get-ChildItem], ParameterBindingException
+ FullyQualifiedErrorId : NamedParameterNotFound,Mic
rosoft.Pow
erShell.Co
mmands.Get
ChildItemC
ommand
If not, then you need to wrap your directory path in quotes.
Becomes:
Open in new window
Yeah my mistake, look at the answer above mine, quick read-through I did I didn't realize you were running into an issue of trying to run newer Powershell commands in an older PS environment, the above answer answers this succinctly.