草庐IT

ChildItem

全部标签

windows - 将变量与包含开关一起使用时 Get-ChildItem 失败

Powershellv4.0Windows7此代码有效并检索了我要查找的2个文件:$dir=Get-Item-Path"C:\TestSource"Get-ChildItem-Path"$($dir.FullName)\*"-File-Include*.txt,*.inf此代码也有效,但它只能找到txt文件:$Dir=Get-Item-Path"C:\TestSource"$Filter="*.txt"Get-ChildItem-Path"$($dir.FullName)\*"-File-Include$Filter但是,这不会返回任何对象:$Dir=Get-Item-Path"C:\

windows - Powershell Get-ChildItem - 后续调用相同路径时缺少 header

试图弄清楚如何让Powershell在对同一目录路径的后续请求中显示header详细信息。这是我正在尝试做的一个简化示例,请注意对Get-ChildItem的第二次调用不显示header详细信息(大概是因为它知道它之前已经在同一个脚本block中调用过):PSC:\TEMP\foo>$path="c:\temp\foo";Get-ChildItem-Path$path;Write-Output"Deletesomethinganddisplaydirectorycontentsagain...";del$path\*5*;Get-ChildItem-Path$pathDirectory

android - 从 ExpandableListView 检索 ChildItem?

当用户单击ExpandableListView的子项时,我试图检索子项。为此,我的Activity和ListAdapter类如下所示。主要Activity:-publicclassMainActivityextendsActivity{NewAdaptermNewAdapter;@OverridepublicvoidonCreate(BundlesavedInstanceState){super.onCreate(savedInstanceState);setContentView(R.layout.main);ExpandableListViewexpandbleLis=(Expan

windows - 在 powershell 2 中仅返回带有 Get-childitem 的文件

这个问题在这里已经有了答案:Howtodeleteallthefilesinafolderexceptread-onlyfiles?(3个答案)关闭6年前。我知道我们可以在PowershellV3.0中使用参数-File但我们如何才能在PowershellV2中使用Get-childitemcmdlet只获取文件?

windows - Powershell get-childitem 输出格式

如何更改powershell输出的格式?我正在运行这个:cgi-RecurseK:\AppData\*.*-Filter*.model|?{$_.LastWriteTime-gt(Get-Date).AddDays(-6)}|sortLastWriteTime-descending>>C:\AAA\result.txt我得到的结果是这样的格式:Directory:K:\AppData\ModeLastWriteTimeLengthName----------------------------a---13/02/201411:29AM726912920-300_3001_REV02_E