该目录中有20k个文件夹.这些文件夹中有子文件夹和一些文件.我不需要查看子文件夹.我需要得到所有的文件.文件夹中的EIA扩展.
我知道我可以为此使用Get-Item、Get-ChildItem,但这些cmdlet获取数据的速度太慢.此外,此脚本必须每小时运行一次,因此不能占用超长时间.
我试图使用[System.IO.File]::GetFiles($path)
,但这给出了一个错误
Method invocation failed because [System.IO.File] does not contain a method named 'GetFile'
我也试过了
$pathEia = "\\Sidney2\MfgLib\AidLibTest\*\*.EIA"
[System.IO.File]::GetFiles($pathEia)
这还会引发一个错误:
Exception calling "GetFiles" with "1" argument(s): "The filename, directory name, or volume label
| syntax is incorrect. : '\\Sidney2\MfgLib\AidLibTest\*\*.EIA'"
我正在使用