I have a Powershell script which grabs the codecs used by various video files. The Write-Host command is working correctly and I can see the desired output in the terminal. But the Out-File part is not working and only creates an empty file.
Can anyone tell me why the Out-File is not working?
$codec = ffprobe -i $vidfile -hide_banner -v error -select_streams v:0 -show_entries stream=codec_name -of default=noprint_wrappers=1:nokey=1
Write-Host "Processing" $vidfile "Codec:" $codec -Append | Out-File -Filepath "Z:\Movies\codecs.txt"