![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | possibly pipe max? Hi, I am trying to list out perms recursively for a directory via cacls and I need to remove some strings. Is there a limit to the number of pipes allowed? I wouldn't think so. Here is the script: $dir = read-host -prompt "Enter starting directory for cacls list " dir -r $dir | ?{$_.mode -match "d"}|%{$_.get_fullname()} |%{cacls $_}|%{ $_ = $_.replace("(OI)","") $_ } When I do this interactively,it works: cacls d:\test | %{$_.replace("(OI)","")} |
My System Specs![]() |
| | #2 (permalink) |
| | RE: possibly pipe max? Nevermind, I just need to put the "|" inside. ,ie dir -r $dir | ?{$_.mode -match "d"}|%{$_.get_fullname()} |%{cacls $_|%{ $_ = $_.replace("(OI)","") $_ } } Thanks, "Frank" wrote: Quote: > Hi, > > I am trying to list out perms recursively for a directory via cacls and I > need to remove some strings. Is there a limit to the number of pipes > allowed? I wouldn't think so. Here is the script: > > $dir = read-host -prompt "Enter starting directory for cacls list " > dir -r $dir | ?{$_.mode -match "d"}|%{$_.get_fullname()} |%{cacls $_}|%{ > $_ = $_.replace("(OI)","") > $_ > } > > When I do this interactively,it works: > > cacls d:\test | %{$_.replace("(OI)","")} |
My System Specs![]() |
| | #3 (permalink) |
| | 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)","") > $_ > } > } > ?{!$_.PSIsContainer} to match files) and rather than use $_.get_fullname() just use the property $_.FullName. -- Keith |
My System Specs![]() |
| | #4 (permalink) |
| | Re: possibly pipe max? test "Keith Hill [MVP]" wrote: Quote: > "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 Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Re: Possibly OT--An alternative to WLM | Live Mail | |||
| Possibly problem on startup~ | General Discussion | |||
| Vista Network Trouble (possibly going from public to private, possibly something else) | Vista General | |||
| How would I possibly get this work? | Virtual Server | |||
| Pipe a pipe command to a file | VB Script | |||