I have a setup where a dozen randomly chosen mpg's are chosen from 12 folders and then sent to a playlist to play. What I'm trying to add is the ability to keep track or a log of the mpg when it is played and not replay it until all mpg's in a folder have been played once. So in other words, I will be picking a random file/shuffling, and not repeating; playing all once before any one is repeated. It should also be able to keep track of this day to day with the pc being turned off and on again.
I am currently running this script that I found.
$formats =
@("*.mpg")
$dir = Split-Path $MyInvocation.MyCommand.Path
gci "$dir\*" -include $formats | Get-Random -Count 1 |
Invoke-Item
I would like to add script to this .ps1 file I'm calling PlayRandom.ps1
I would like the script to create a log of each file played, and read that log before picking a new file at random. If the file has already been chosen, then do not choose it, until all files have been played. Then it can reset the choice of files to play. Basically so that I can have a random, no repeat, play all once, script for my playlist.
Aucun commentaire:
Enregistrer un commentaire