# encoding: ascii
# api: powershell
# title: Search-PoshcodeScript
# description: I found this script very useful. Enjoy!:)
# version: 0.1
# type: function
# author: greg zakharov
# license: CC0
# function: Search-PoshcodeScript
# x-poshcode-id: 5419
# x-archived: 2015-01-31T20:28:29
# x-published: 2015-09-12T05:35:00
#
#
function Search-PoshcodeScript {
  <#
    .EXAMPLE
        PS C:\> Search-PoshcodeScript "logon users"
    .NOTES
        Author: greg zakharov
  #>
  param(
    [Parameter(Mandatory=$true)]
    [String]$ScriptName
  )
  
  &(([Regex]"(?<=`")(.*)(?=`"\s)").Match(
    (cmd /c ftype (cmd /c assoc .html).Split('=')[1])
  ).Value) ('http://poshcode.org/?lang=&q=' + $ScriptName -replace '\s', '+')
}
