/\/\o\/\/ PowerShelled

This blog has moved to http://ThePowerShellGuy.com Greetings /\/\o\/\/
$AtomFeed = ("Atom.xml")
$PreviousItems = (" Search with MSNSearch Web API from MSH (Part 2) "," Search with MSNSearch Web API from MSH (Part 1) "," about_Switch Documentation "," Switch -regEx "," Dir, Dir and more Dir in MSH "," Simple Show-Image function for Monad "," MSH out-zip Function "," get a Users LastLogontime and Domaincontroller fro... "," Some fun With Monads Add-Member, MP3 files and COM "," MSH snap-in to Translate IADsLargeInteger to Int64 "," ")

Friday, February 03, 2006

 


Check spelling with MSN Search from MSH (Part 3)



A small word checker for MSH using MSN Search,

it uses the Culture of the MSH Shell, but you can overrule it.
it works like this :

MSH>check-spelling januar
january
MSH>check-spelling januar nl-nl
januari
MSH>


the script looks like this :

# Check-Spelling 
# checks spelling of a word using MSN Search Web Service   
# /\/\o\/\/ 2006  
# http://mow001.blogspot.com 

Function Check-Spelling {
  param([string]$word,
        [string]$Culture = (get-Culture).name
       )
  $MSN = new MSNSearchService

  $s = new SourceRequest
  $s.source = [sourcetype]::spelling
  $s.ResultFields = ([ResultFieldMask]::All)

  $sr = new SearchRequest
  $sr.AppID = "Your AppID here !!!!!"
  $sr.Requests = $S
  $sr.Flags = [SearchFlags]::None
  $sr.CultureInfo = $Culture
  $sr.query = $word

  $r = new sourceResponse
  $r = $MSN.Search($sr)
  $r.responses[0].results | foreach {$_.Title}
}



(for getting the DLL and AppID Needed see, Search with MSN Search Web API from MSH (Part 1))

gr /\/\o\/\/
Tags :

PS I'm also working on extending the search example of the 2nd part of this series,
for now 2 quick fixes I did I thinks are handy :

# fixes on example part 2

# Overrule the Prompt to show result Count (I did rename prompt-continue) :

    $Choice = Prompt-Choice -caption "Showing : $($S.Offset) to $($S.Offset + 9) of $($r.Responses[0].total) Results"

# Fix for opening explorer on empty URL
 
   [0-9] {
           if ($r.responses[0].results[($_)].url) {
             (new-object -com shell.application).ShellExecute($r.responses[0].results[($_)].url)
           }
         }



Comments:
Blogger /\/\o\/\/
"I did I thinks are handy "

and I dare to post about spelling ?

MSH>do-msnsearch Dunglish
[0] Dunglish

Although Dunglish is being used to hype up something, it still ends up dumbing it down. While the Netherlands is still heavily debating the
latest round of spelling changes, Dunglish marches on, as if ...
http://www.dunglish.nl/

I lucky i'm not on it yet :

but then again .. ;-)

MSH>do-msnsearch site:www.dunglish.nl mow

[0] Dunglish » Blog Archive » I'm going on vacation!
I don't want to mow the grass before your feet" = "Ik wil u het gras niet voor de voeten wegmaaien" = "I don't want to take credit for what
you accomplished". "Are you standing behind ...
http://www.dunglish.nl/?p=78

LOL
 
Post a Comment



<< Home

Archives

October 2005   November 2005   December 2005   January 2006   February 2006   March 2006   April 2006   May 2006   June 2006   July 2006   August 2006   September 2006   October 2006   November 2006   December 2006  

$Links = ("PowerShell RC1 Docs"," PowerShell RC1 X86"," PowerShell RC1 X64"," Monad GettingStarted guide"," Monad Progamming Guide"," Monad SDK"," Monad videos on Channel 9"," MSH Community Workspace"," scripts.readify.net "," MonadSource"," www.reskit.net"," PowerShell Blog"," Under The Stairs"," computerperformance powershell Home"," proudlyserving"," MSH on wikipedia"," MSHWiki Channel 9"," Keith Hill's Blog"," Precision Computing"," PowerShell for fun"," MSH Memo (Japanese)"," monadblog")

find-blog -about "PowerShell","Monad" | out-Technorati.
find-blog -contains "","" | out-Technorati.
Google
 
Web mow001.blogspot.com

This page is powered by Blogger. Isn't yours?