Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Powershell Get ChildItem仅获得170个项目_Powershell_Powercli - Fatal编程技术网

Powershell Get ChildItem仅获得170个项目

Powershell Get ChildItem仅获得170个项目,powershell,powercli,Powershell,Powercli,当我运行下面的程序时,我只得到170个项目。我更新了我的powershell版本以防万一。我相信get-childitem可能存在一个问题,它处理得越慢,但速度相当快,然后完全停止。是否有可以调整的尺寸限制 $datastore = Get-Datastore -name "mystore" New-PSDrive -Location $datastore[0] -Name ds -PSProvider VimDatastore -Root “\” set-location ds:\ Get-C

当我运行下面的程序时,我只得到170个项目。我更新了我的powershell版本以防万一。我相信get-childitem可能存在一个问题,它处理得越慢,但速度相当快,然后完全停止。是否有可以调整的尺寸限制

$datastore = Get-Datastore -name "mystore"
New-PSDrive -Location $datastore[0] -Name ds -PSProvider VimDatastore -Root “\”
set-location ds:\
Get-ChildItem -Include *.iso -name -recurse


“完全停止”是什么意思。。。如果要“搜索”的文件夹稍大,它可能仍在运行并查找*ISO文件!?命令行将无法再次输入,但我将它保留一个小时,不再显示给我。第一行每秒填充不到1行,然后就好像暂停一样。大约有30个文件夹,其中包含不同数量的文件,每个文件夹可能有20个,因此我希望返回600个项目。每个文件的大小约为1GB,但由于我正在使用-name开关,因此不确定这是否有效。我不知道这是否有帮助,但是您可以尝试
-Filter*.iso
-Filter
在源代码处匹配-如果提供商支持它-并且比
-Include
快得多。为了弄清楚这种行为的原因,您可以尝试使用
robocopy/L
,排除所有其他内容,如文件和目录的连接点等东西您是否尝试使用资源管理器评估结果?刚刚使用资源管理器,发现有人在其中放置了Visual Studio的脱机安装程序,其中包含许多文件和文件夹。exclude命令是否能够避免这种情况?
Name                           Value
----                           -----
PSVersion                      5.1.15063.1155
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.15063.1155
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1