Search PowerShellers and other PowerShell-related sites
Showing posts with label script. Show all posts
Showing posts with label script. Show all posts

Thursday, May 29, 2008

Search PowerShellCentral Script Repository

This is simple function that will help you search PowerShellCentral Script Repository right from the command line.

function Search-PSCentral {
param([string]$keyword)
(New-Object –com Shell.Application).Open("http://powershellcentral.com/scripts/?lang=&q=*$keyword*")
}


Usage: Search-PSCentral ini

If you leave out a keyword or there are no results, the page will open ready for you to paste in some code and fill the gap. :-)

Monday, July 2, 2007

Translate with Google Dictionary Translation and PowerShell

Google Translate has added a nifty new feature: dictionary translation. Dictionary translation is currently available between English and French, Italian, German, Spanish, and Korean. You can get it right from the command line with a little help from PowerShell.



# Usage:
# Get-Translation -word power -dictionary ef
# Get-Translation shell ei
# gt "ab und zu" de

Function Get-Translation {
param([string]$word="",[string]$dictionary="")

switch($dictionary) {
ef {$langpair = "en%7Cfr"} # English-French
fe {$langpair = "fr%7Cen"} # French-English
ed {$langpair = "en%7Cde"} # English-German BETA
de {$langpair = "de%7Cen"} # German-English BETA
ei {$langpair = "en%7Cit"} # English-Italian
ie {$langpair = "it%7Cen"} # Italian-English
ek {$langpair = "en%7Cko"} # English-Korean
ke {$langpair = "ko%7Cen"} # Korean-English
es {$langpair = "en%7Ces"} # English-Spanish
se {$langpair = "es%7Cen"} # Spanish-English
}

$objIE = New-Object -Com Internetexplorer.Application
$url = "http://translate.google.com/translate_dict?q=" + $word + "&sa=N&hl=en&langpair=" + $langpair
$objIE.Navigate($url)
$objIE.Visible=$true
}

Set-Alias gt Get-Translation




A dictionary translation of your word or short phrase will be displayed in Internet Explorer.