1
我想列出這個腳本只找到10000個第一個文件,但我找不到一個方法使它工作。 腳本是這樣的:使一個Powershell腳本只需要找到這個過濾器定義的第一個10000個文件
$totalList = @()
Get-Item 'D:\tempfolder\*\' | % {
$dir = $_.FullName
$list = Get-ChildItem $dir -recurse *.zip | sort modifyTime -desc | select -skip 2
$totalList = $totalList + $list;
}
$totalList = $totalList -take 10000
如預期的那樣-Take 1000不能正常工作,所以我怎麼可以定義多個文件應該找到最大?
你可以嘗試$ totalList = $ totalList |選擇 - 首先10000 –
已經嘗試,但你不能管。謝謝 – RayofCommand
對不起,它的工作原理。但只有當我輸出文件中的輸出。奇怪。 – RayofCommand