Private/Update-TvDataCache.ps1
function Update-TvDataCache { param ( ) $HttpClient = New-Object -TypeName 'System.Net.Http.HttpClient' $Stream = $HttpClient.GetStreamAsync('https://iptv-org.github.io/epg/guides/nl/ziggogo.tv.epg.xml.gz').GetAwaiter().GetResult() $GzipStream = New-Object -TypeName "System.IO.Compression.GzipStream" $Stream, ([System.IO.Compression.CompressionMode]::Decompress) $StreamReader = New-Object -TypeName 'System.IO.StreamReader' $GzipStream $script:TvDataCache = [xml]($StreamReader.ReadToEnd()) } |