Search TechNet Script Center Forum for Unanswered PowerShell Questions

I wanted a quick and easy way to search the TechNet Script Center forums for all questions that had the word “PowerShell” in either the title or in the question itself. Here is what I came up with:

001
002
003
004
005
006
007
008
009
010
011

Function Get-ScriptCenterUnanswered {
$url = 
"http://social.technet.microsoft.com/Forums/en/ITCG/threads?outputAs=rss&filter=unanswered"
$web
 = New-Object System.Net.WebClient
$rss = $web.downloadString($url)
$cleaned = $rss -replace  '',
""
$xml
 = [xml]
$cleaned
$xml
.rss.channel.item | ? {
        ($_.Title -like "*powershell*") -or ($_.Description -like "*powershell*")
 
       
} | fl title,link
}

You can use a filter to get only the unanswered questions. Once I pulled those down, I found that it was giving me some odd characters at the beginning of the feed. I just used the –replace operator to get rid of them. Once I did that, I can convert to XML and treat the output as an object and use the where-object cmdlet to filter the output based on my criteria.

I slapped this together in about 10 minutes so this is not very reusable – but I thought I would share.

-Andy

Pingbacks and trackbacks (1)+

Comments are closed