Powershell-Utility icon indicating copy to clipboard operation
Powershell-Utility copied to clipboard

Podcast XML formating

Open ManFromDelMunky opened this issue 5 years ago • 0 comments

In reference to your Podcast PowerShell Module. First of all this is an excellent module it was exactly what I was looking for. I did however find one annoying podcast that appears to have an XML BOM at the start of "???" It appears that this then wont load in as XML as the parser throws an error. http://www.john00fleming.co.uk/mixes/podcasts/Nov08/podcast.xml I fixed it by using quick check Try { [String]$PodcastString = Invoke-WebRequest -Uri $PodcastURL If($PodcastString -like '???*') { $Trim = [String]$PodcastString.TrimStart("???") [xml]$PodcastFeed = $Trim } Else { [xml]$PodcastFeed = Invoke-WebRequest -Uri $PodcastURL }

There are probably better ways of doing it but hey thought you might want to know.

ManFromDelMunky avatar Jun 19 '19 13:06 ManFromDelMunky