$path = "画像があるフォルダのpath"
#画像サイズを取得するためのAssembly
Add-Type -AssemblyName System.Drawing
#拡張子が.jpgのファイルのpathを再帰的に取得し$image_path_aryに入れる
$image_path_ary = Get-ChildItem -Path $path -Recurse -Include "*.jpg" | Select-Object -ExpandProperty FullName
#条件に当てはまる画像pathを入れる配列を定義
$err_images =@()
#forする
$image_path_ary | % {
$tmp_Width = [Drawing.Image]::FromFile($_).Width
$tmp_Height = [Drawing.Image]::FromFile($_).Height
#縦か横が640ピクセル以下の画像を判定し$err_imagesにいれる
if($tmp_Width -le 640){
$err_image += $_
}elseif($tmp_Height -le 640){
$err_image += $_
}
}
#結果確認
$err_image.count
$err_image
$err_imageをMove-Itemして小さい画像のみフォルダへ
Move-Item -Path "移動させるファイルのpath" -Destination "移動先のpath"