![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| 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) |
| | get-childitem . -Name | where {$_.PsIsContainer} not working in 1. Hi, The following command works on RC1 and RC2, but it dosen't work on the powershell 1.0 release. get-childitem . -Name | where {$_.PsIsContainer} This above command returns all directories only. This dosen't return any results in powershell 1.0. Does anyone know if this is a bug and how can I overcome this. Thanks, Bharat |
My System Specs![]() |
| | #2 (permalink) |
| | RE: get-childitem . -Name | where {$_.PsIsContainer} not working in 1. The following gets all sub-directories of the current folder: get-childitem | where {$_.PsIsContainer} --George "brato" wrote: > Hi, > > The following command works on RC1 and RC2, but it dosen't work on the > powershell 1.0 release. > > get-childitem . -Name | where {$_.PsIsContainer} > > This above command returns all directories only. This dosen't return any > results in powershell 1.0. Does anyone know if this is a bug and how can I > overcome this. > > Thanks, > Bharat |
My System Specs![]() |
| | #3 (permalink) |
| | RE: get-childitem . -Name | where {$_.PsIsContainer} not working i No I want only the directory names. So the one below dosen't work for me. -Name returns only the directory names. Thanks, Bharat "George Davis" wrote: > The following gets all sub-directories of the current folder: > > get-childitem | where {$_.PsIsContainer} > > --George > > "brato" wrote: > > > Hi, > > > > The following command works on RC1 and RC2, but it dosen't work on the > > powershell 1.0 release. > > > > get-childitem . -Name | where {$_.PsIsContainer} > > > > This above command returns all directories only. This dosen't return any > > results in powershell 1.0. Does anyone know if this is a bug and how can I > > overcome this. > > > > Thanks, > > Bharat |
My System Specs![]() |
| | #4 (permalink) |
| | RE: get-childitem . -Name | where {$_.PsIsContainer} not working i Get-ChildItem . | where{$_.Psiscontainer} | select name will do what you want. According to the help file on get-childitem if you use -name it will only pass the name into the pipeline which is why you can't then use the where cmdlet -- Richard Siddaway Please note that all scripts are supplied "as is" and with no warranty Blog: http://richardsiddaway.spaces.live.com/ PowerShell User Group: http://www.get-psuguk.org.uk "brato" wrote: > No I want only the directory names. So the one below dosen't work for me. > -Name returns only the directory names. > > Thanks, > Bharat > > "George Davis" wrote: > > > The following gets all sub-directories of the current folder: > > > > get-childitem | where {$_.PsIsContainer} > > > > --George > > > > "brato" wrote: > > > > > Hi, > > > > > > The following command works on RC1 and RC2, but it dosen't work on the > > > powershell 1.0 release. > > > > > > get-childitem . -Name | where {$_.PsIsContainer} > > > > > > This above command returns all directories only. This dosen't return any > > > results in powershell 1.0. Does anyone know if this is a bug and how can I > > > overcome this. > > > > > > Thanks, > > > Bharat |
My System Specs![]() |
| | #5 (permalink) |
| | Re: get-childitem . -Name | where {$_.PsIsContainer} not working i "RichS" <RichS@discussions.microsoft.com> wrote in message news:0680228B-1115-4DAF-9F91-512272A50AB0@microsoft.com... > Get-ChildItem . | where{$_.Psiscontainer} | select name > > will do what you want. According to the help file on get-childitem if you > use -name it will only pass the name into the pipeline which is why you > can't > then use the where cmdlet Yep that name is passed as a string type which doens't have a PSIsContainer property. Rich's approach is the one I would take. -- Keith |
My System Specs![]() |
| | #6 (permalink) |
| | Re: get-childitem . -Name | where {$_.PsIsContainer} not working i Another way Perhaps Microsoft's Log Parser 2.2 PS> LogParser -h -i:fs Input format: FS (FileSystem properties) Returns properties of files and folders |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| get-childitem -exclude bug | PowerShell | |||
| get-childitem bug? | PowerShell | |||
| using Get-ChildItem | PowerShell | |||
| get-childitem | PowerShell | |||
| Problem with Get-ChildItem | PowerShell | |||