View Single Post
Old 11-20-2007   #3 (permalink)
Keith Hill [MVP]


 
 

Re: possibly pipe max?

"Frank" <Frank@xxxxxx> wrote in message
news:157ADA17-F09E-48D6-94A5-B350B4E5A4C4@xxxxxx
Quote:

> Nevermind, I just need to put the "|" inside. ,ie
>
> dir -r $dir | ?{$_.mode -match "d"}|%{$_.get_fullname()} |%{cacls $_|%{
> $_ = $_.replace("(OI)","")
> $_
> }
> }
>
A few tips. I would use ?{$_PSIsContainer} to match dirs (and
?{!$_.PSIsContainer} to match files) and rather than use $_.get_fullname()
just use the property $_.FullName.

--
Keith

My System SpecsSystem Spec