theerayuth.p
$pdf = pdftk.exe $_.FullName dump_data $NumberOfPages = 0 $NumberOfPages = [regex]::match($pdf,’NumberOfPages: (\d+)’).Groups[1].Value
$infoObj = New-Object PSObject -Property @{ Name = $_.Name FullName = $_.FullName NumberOfPages = $NumberOfPages } #บันทึกข้อมูลลง file $infoObj.”FullName”,$infoObj.”NumberOfPages” -join ‘,’ | Out-File -FilePath $FilePath -Append -Width 200; }
5. Save แล้วก็ Execute เพื่อทดสอบได้เลยครับ