Function Get-SearchResults { param([string] $searchstring=$(throw "Please specify a search string.")) $client = New-Object System.Net.WebClient $url="http://www.bing.com/search?q={0}`&format=rss" -f $searchstring [xml]$results = $client.DownloadString($url) $channel = $results.rss.channel foreach ($item in $channel.item) { $result = New-Object PSObject $result | Add-Member NoteProperty Title -value $item.title $result | Add-Member NoteProperty Link -value $item.link $result | Add-Member NoteProperty Description -value $item.description $result | Add-Member NoteProperty PubDate -value $item.pubdate $sb = { $ie = New-Object -com internetexplorer.application $ie.navigate($this.link) $ie.visible = $true } $result | Add-Member ScriptMethod Open -value $sb $result } } Get-SearchResults "PowerShell"