PowerShell/Vidéo

Aller à la navigation Aller à la recherche

Pour les traitements vidéos.

Déplacement de fichier vidéo, version 1

Clear-Host
Set-Location "D:\_Brut\"
$dateheure = Get-Date -UFormat "%Y%m%d-%H%M%S"

$filmListe1280 = Get-ChildItem -Filter "*.mkv" | ? { $_.Name -match '(?:1280.*q23)' -and ($_.length -gt 50) }
#$filmListe1920 = Get-ChildItem -Filter "*.mkv" | ? { $_.Name -match '(?:1920.*q23)' -and ($_.length -gt 50) }

Write-Host "Date courante : $dateheure"
Foreach ($film in $filmListe1280) { 
    Write-Host ("* {0} : {1:N2} Go" -f $film, ($film.Length/1GB))
    Move-Item $film -Destination "E:\video-1280\"
}
Write-Host
Write-Host ("Nombre d'éléments : {0}" -f $filmListe1280.Count)

Déplacement de fichier vidéo, version 2

Clear-Host
Set-Location "D:\_Brut\"
$dateheure = Get-Date -UFormat "%Y%m%d-%H%M%S"

$filmListe1280 = Get-ChildItem -Filter "*.mp4" | ? { $_.Name -Match '(?:1280.*q23)' -And ($_.length -gt 50) } | Sort-Object -Property Length
$filmListe1920 = Get-ChildItem -Filter "*.mp4" | ? { $_.Name -Match '(?:1920.*q23)' -And ($_.length -gt 50) } | Sort-Object -Property Length

Write-Host "Date courante : $dateheure"
Foreach ($film in $filmListe1280) { 
    Write-Host ("* {0} : {1:N2} Go" -f $film, ($film.Length/1GB))
    Move-Item $film -Destination "E:\video-1280\"
}
Foreach ($film in $filmListe1920) { 
    Write-Host ("* {0} : {1:N2} Go" -f $film, ($film.Length/1GB))
    Move-Item $film -Destination "E:\video-hd\"
}

Write-Host
Write-Host ("Nombre d'éléments 1280 : {0}" -f $filmListe1280.Count)
Write-Host ("Nombre d'éléments 1920 : {0}" -f $filmListe1920.Count)

Voir aussi

  •