Public/Get-iPlayerFeatured.ps1
function Get-iPlayerFeatured { param() 1..2 | ForEach-Object { ConvertTo-HtmlDocument -Uri "https://www.bbc.co.uk/iplayer/group/featured?page=$_" | Select-HtmlNode -CssSelector '#tvip-script-app-store' | Select-Object -ExpandProperty InnerText | ForEach-Object { $_ -replace '^window\.__IPLAYER_REDUX_STATE__ = ', '' -replace ';$', '' } | ConvertFrom-Json -Depth 10 | Select-Object -ExpandProperty entities | Select-Object -ExpandProperty contentItemProps | ForEach-Object { [PSCustomObject]@{ PSTypeName = 'UncommonSense.iPlayer.Featured' Title = $_.title Synopsis = $_.synopsis Duration = $_.duration Image = ($_.sources[0].srcset -split ',')[0] -replace '\d+x$','' Link = $_.href } } } } Get-iPlayerFeatured |