![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | 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) |
| Guest | 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) |
| Guest | 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) |
| Guest | 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) |
| Guest | 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) |
| Guest | 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 | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| get-childitem bug? | RJ | PowerShell | 2 | 02-29-2008 01:29 PM |
| using Get-ChildItem | foamy | PowerShell | 9 | 02-15-2008 04:32 AM |
| get-childitem | Brandon Shell [MVP] | PowerShell | 4 | 12-03-2007 12:58 PM |
| Bug in Get-ChildItem -exclude | loworbit@gmail.com | PowerShell | 4 | 12-19-2006 05:58 PM |
| Understanding Get-ChildItem | Staffan Gustafsson | PowerShell | 1 | 06-12-2006 07:05 PM |