I have tried using the following commands. (bear in mind I am very new to PS)
Hopefully someone can point me in the right direction.
get-childitem c:\scripts -recurse|where-object{$_.psiscontainer} |
foreach-object{$acl=get-acl} if (!$acl.AreAccessRulesProtected){get-acl}
I get the following error.
ForEach-Object : Cannot bind parameter 'Process'. Cannot convert the "if"
value
of type "System.String" to type "System.Management.Automation.ScriptBlock".
At line:1 char:82
+ get-childitem c:\scripts -recurse|where-object{$_.psiscontainer}|
foreach-ob
ject <<<< {$acl=get-acl} if (!$acl.AreAccessRulesProtected){get-acl}
+ CategoryInfo : InvalidArgument: (

[ForEach-Object], Parameter
BindingException
+ FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Microsoft.PowerSh
ell.Commands.ForEachObjectCommand
The following generates a list of the subfolders.
get-childitem c:\scripts -recurse|where-object{$_.psiscontainer}
The following just brings up a new prompt
get-childitem c:\scripts -recurse|where-object{$_.psiscontainer} |
foreach-object{$acl=get-acl} if (!$acl.AreAccessRulesProtected)
Again, thanks for the help.
Kevin