powershell 7 (pwsh) as parallel runner

busylog
·
$process = Get-Process -Id $pid
$process.PriorityClass = 'idle'
get-item .\*.jpg | foreach-object -ThrottleLimit NUM_CORES -Parallel { cwebp.exe -metadata exif $_.Name -o ("OUTPUTPATH" + $_.Name).replace('jpg','webp') }

PowerShell 7 can be found on Microsoft Store:
https://apps.microsoft.com/store/detail/powershell/9MZ1SNWT0N5D
Get-ChildItem -recurse (-filter / -include), and $_.Fullname may be useful.

Note: disable windows defender, explorer thumbnail for higher performance (SystemPropertiesAdvanced).

reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "IconsOnly" /t Reg_DWord /d 00000001 /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "ShowPreviewHandlers" /t Reg_DWord /d 00000000 /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "ShowTypeOverlay" /t Reg_DWord /d 00000000 /f
评论
社区准则 博客 联系 反馈 状态
主题