【发布时间】:2014-05-08 08:08:55
【问题描述】:
我查看了 Get-ChildItem 命令返回的对象的可用属性:
PS C:\> Get-ChildItem | Get-Member
此命令显示 Get-ChildItem 命令返回的对象具有属性“名称、全名、上次访问时间等...”
我声明了一个变量来检索以“程序”开头的对象:
PS C:\> $ChildItems_Program = Get-ChildItem -name 'Program*'
检查 $ChildItems_Program 中存储的内容
PS C:\> $ChildItems_Program
Program Files
Program Files (x86)
尝试从 $ChildItems_Program 中保存的第一个对象访问属性“Name、FullName、LastAccessTime”
PS C:\> $ChildItems_Program[0] | Select -Property Name, FullName, LastAccessTime
Name FullName LastAccessTime
---- -------- --------------
为什么我看不到上述命令的任何结果 - 它不应该返回保存在 $ChildItems_Program 中的第一个对象的属性吗? 谁能指导一下。
谢谢!
【问题讨论】:
标签: powershell windows-7 powershell-2.0