AddPlaylist.ps1

param(
[Parameter(Mandatory = $false)] [string] $siteUrl = "https://yourtenant.sharepoint.com/sites/TestSa",

[Parameter(Mandatory = $false)]
[string]
$listTitle = "TestPL10",

[Parameter(Mandatory = $false)]
[string]
$listDesc = "Test PL10 desc",

[Parameter(Mandatory = $false)]
[string]
$listUrl = "Test-PL10"    

)

Connect-PnPOnline -Url $siteUrl -Interactive

Invoke-PnPSiteTemplate -Path "pnp-playlisttemplate.xml" -Parameters @{"ListTitle" = $listTitle; "ListDescription" = $listDesc; "ListUrl" = $listUrl }

$newList = Get-PnPList -Identity $listTitle

$newList.TemplateTypeId = "3a867b4a-7429-0e1a-b02e-bf4b240ff1ce"

$newList.Update();

Invoke-PnPQuery;