I found a post that was supposed to show a/v time length, but it does not show the time: hh:mm:ss.
Can powershell display a/v time length (I have never used powershell)?
If so, can someone show me how to modify the code below to show the time length?
I have used simple batch files in dos, but never anything more than that.
Thanks, Tracey
I pasted the 2nd section into a powershell and there were a lot of errors, but the date, size, (plus others) did show, but not the hh:mm:ss.
$Directory = “D:\My Source Folder”
$Shell = New-Object -ComObject Shell.Application
Get-ChildItem -Path $Directory -Recurse -Force | ForEach {
$Folder = $Shell.Namespace($.DirectoryName)
$File = $Folder.ParseName($.Name)
$Duration = $Folder.GetDetailsOf($File, 27)
[PSCustomObject]@{
Name = $.Name
Size = "$([int]($.length / 1mb)) MB"
Duration = $Duration
}
} | Export-Csv -Path “./temp.csv” -NoTypeInformation
$Directory = “D:\My Source Folder”
$Shell = New-Object -ComObject Shell.Application
Get-ChildItem -Path $Directory -Recurse -Force
ForEach {
$Folder = $Shell.Namespace($.DirectoryName)
$File = $Folder.ParseName($.Name)
$Duration = $Folder.GetDetailsOf($File, 27)
[PSCustomObject]@{
Name = $.Name
Size = "$([int]($.length / 1mb)) MB"
Duration = $Duration
}
}
Export-Csv -Path “./temp.csv” -NoTypeInformation