Created
June 26, 2015 13:03
-
-
Save pierre3/19f8e40410a758c2745d to your computer and use it in GitHub Desktop.
google web search commandlet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Search-Google | |
{ | |
[CmdletBinding()] | |
Param( | |
# 検索ワード | |
[Parameter(Mandatory=$true, | |
ValueFromPipeline=$true, | |
Position=0)] | |
[PSObject[]] | |
$SearchWords | |
) | |
Begin | |
{ | |
$words = @() | |
} | |
Process | |
{ | |
$words += $SearchWords | |
} | |
End | |
{ | |
$url = "https://www.google.co.jp/search?q={0}" -f ($words -join '+') | |
start $url | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment