create this step –
- map the video folder
- create loop to files in folder
- load comObject to help us read the ‘Duration’ property from file.
- order result to object.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
### Display Video Duration $Length = @() $Folder = "C:\Users\User\Videos\CBT Nuggets - Linux in the Real World" foreach ($file in Get-ChildItem $Folder) { $Name = $file.Name $LengthColumn = 27 $objShell = New-Object -ComObject Shell.Application $objFolder = $objShell.Namespace($Folder) $objFile = $objFolder.ParseName($Name) $Len = $objFolder.GetDetailsOf($objFile, $LengthColumn) $Object = New-Object System.Object $Object | Add-Member -type NoteProperty -Name FileName -Value $Name $Object | Add-Member -type NoteProperty -Name Length -Value $len #$Object | Add-Member -type NoteProperty -Name FileName -Value $Name $Length += $Object } $Length |
Enjoy your movie!
(Visited 6,889 times, 1 visits today)