Skip to content

Instantly share code, notes, and snippets.

@Pxtl
Created December 26, 2019 05:24
Show Gist options
  • Save Pxtl/fd7bf1dc8f3720beccbf3a8db357670b to your computer and use it in GitHub Desktop.
Save Pxtl/fd7bf1dc8f3720beccbf3a8db357670b to your computer and use it in GitHub Desktop.
Use Powershell to create a ps1 m3u compatible with Lakka
# create an m3u from the given list of files
[cmdletbinding()]
param(
[Parameter(Mandatory)][string] $targetFilePath,
[Parameter(Mandatory)][IO.FileInfo[]]$sourceCuePaths
)
$targetFilePath = [IO.Path]::ChangeExtension($targetFilePath, 'm3u')
$m3uBodyArray = $sourceCuePaths | foreach-object {
[IO.Path]::GetFileName($_)
}
$m3uBody = $m3uBodyArray -join "`r`n"
new-item -ItemType File $targetFilePath -value $m3uBody
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment