Reputation: 372
I am running the following command:
([xml](new-object net.webclient).DownloadString(
"http://blogs.msdn.com/powershell/rss.aspx"
)).rss.channel.item | format-table title,link
The output for one of the RSS items contains this weird text:
You Don’t Have to Be An Administrator to Run Remote PowerShell Commands
So, the question is:
Don’t
when it should just render as Don't
?Upvotes: 5
Views: 6936
Reputation: 18061
You need to set the encoding property of the webclient:
$wc = New-Object System.Net.WebClient
$wc.Encoding = [System.Text.Encoding]::UTF8
([xml]$wc.DownloadString( "http://blogs.msdn.com/powershell/rss.aspx" )).rss.channel.item | format-table title,link
Upvotes: 11