Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
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.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista - possibly pipe max?

Reply
 
Old 11-19-2007   #1 (permalink)
Frank


 
 

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 SpecsSystem Spec
Old 11-19-2007   #2 (permalink)
Frank


 
 

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 SpecsSystem Spec
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
Old 11-28-2007   #4 (permalink)
Joey


 
 

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 SpecsSystem Spec
Reply

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


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46