本帖最后由 newswan 于 2021-7-13 13:45 编辑
回复 3# newswan - $sour = "D:\~","\\PC\Downloads"
- $dest = "D:\xxx"
- do
- {
- $minute = read-host "多少分钟之内"
- $minute = $minute.trim()
- }
- while ($minute -match "\D")
-
- Get-ChildItem -Path $sour -File |
- Where-Object {$_.CreationTime -gt (get-date).AddMinutes(-$minute)} |
- foreach-object {
- write-host $_.fullname
- copy-item $_.fullname -Destination $dest
- }
复制代码 CreationTime 创建时间
LastWriteTime 最后更新时间 |