performance - 有没有更快的方法通过 PowerShell 脚本移动图片
问题描述
如果它们在我的 txt 文件中列出,我想将所有图片从多个文件夹移动到一个目标文件夹。
该脚本有效,但 txt 文件中有大约 81k 图片和 450k 名称(例如samlpe-green-bigpic-detail-3.jpg
),这该死的慢。
有没有办法编写脚本,所以它工作得更快?
$qpath = "c:\sample\picz\"
$Loggit = "c:\sample\pic_move.log"
$txtZeileU = "c:\sample\names.txt"
$d_pic = "C:\sample\moved_picz"
$arrZeileU = Get-Content -Path $txtZeileU
foreach ($Zeile in $arrZeileU) {
Get-ChildItem -Path $qpath -Recurse |
where {$_.Name –eq $Zeile} |
Move-Item -Destination $d_pic -Verbose -Force *>&1 |
Out-File -FilePath $Loggit -Append
}
解决方案
推荐阅读
- javascript - SVG进度圈图像旋转方向
- php - Laravel 密码确认返回 ValidationException
- oracle - 表的循环列的Oracle结构
- java - Thymeleaf + Spring boot - 使用getter方法显示图片
- python - Python 上一行值
- c# - 为什么 Html.Action 在找不到控制器时失败?
- asp.net - 错误:在 gridview 中更新多行时索引超出范围
- docker - Fluent-bit 客户端和 Fluentd 服务器之间的 TLS 问题
- javascript - 如何在反应中将同步数据从功能发送到基于类的组件?
- jquery - 在成功的ajax表单提交上永久更改按钮文本