【PS】PowerShell 脚本读取 rss 新闻

代码
$sapi   =  New - Object  - Com Sapi.SpVoice  
$WebClient   =  New - Object System.Net.WebClient  
# $WebClient.Encoding=[System.Text.Encoding]::GBK  
$rss   =  [XML]( $WebClient .DownloadString( " http://news.com/special//rss_newstop.xml " ))  
foreach ( $item   in   $rss .rss.channel.Item){  
     
$title   =   $item .title.InnerText  
     
$content   =   $item .description.InnerText.Replace( " &nbsp " , "" )  

     
$title   
     
$sapi .Speak( $title )  
     
$content   
     
$sapi .Speak( $content   +   "       " )  
}  


你可能感兴趣的:(powershell)