![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| 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) |
| | How do I use the property of a property? I can do: dir | ft LastWriteTime and I get a list of the last write time for each file in the current directory. But, when I do: dir | ft LastWriteTime.Hour I get a blank line for each file in the directory. Also, when I do: dir | ft LastWriteTime.ThisIsInvalid I get the same results as when I use the .Hour property even though I'm using an invalid property. I think I'm missing something very basic, how do I use the property of a property? Thanks, John Vottero |
My System Specs![]() |
| | #2 (permalink) |
| | Re: How do I use the property of a property? You can use a calculated property: dir | ft @{label='Hour'; expression = {$_.LastWriteTime.Hour}} -a dir | ft LastWriteTime, @{label='Hour'; expression = {$_.LastWriteTime.Hour}} -a -- Kiron |
My System Specs![]() |
| | #3 (permalink) |
| | Re: How do I use the property of a property? Hello John, Try this: PS > dir | ft {$_.LastWriteTime.Hour} -auto To get a nice readable coulmn name use a the full calculted property syntax, see the help for more information: PS > dir | ft @{label = "Hour";expression={$_.LastWriteTime.Hour}} -auto --- Shay Levy Windows PowerShell http://blogs.microsoft.co.il/blogs/ScriptFanatic JV> I can do: JV> JV> dir | ft LastWriteTime JV> JV> and I get a list of the last write time for each file in the current JV> directory. But, when I do: JV> JV> dir | ft LastWriteTime.Hour JV> JV> I get a blank line for each file in the directory. JV> JV> Also, when I do: JV> JV> dir | ft LastWriteTime.ThisIsInvalid JV> JV> I get the same results as when I use the .Hour property even though JV> I'm using an invalid property. JV> JV> I think I'm missing something very basic, how do I use the property JV> of a property? JV> JV> Thanks, JV> JV> John Vottero JV> |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Set Focus To Specific Property In Property Grid | .NET General | |||
| Value under the CPU property? | PowerShell | |||
| How to set file property # to a value > 99 | Vista file management | |||