Skip to content

List-Suggestions

Lists suggestions

param([string]$text = "")

try {
	if ("$text" -eq "") { $text = read-host "Enter a word or sentence to get suggestions for" }
	$URI = [uri]::escapeuristring("suggestqueries.google.com/complete/search?client=firefox&q=$text")
	$Content = (Invoke-WebRequest -URI $URI -useBasicParsing).Content 
	($Content | ConvertFrom-Json).SyncRoot | Select-Object -Skip 1
	exit 0 # success
} catch {
	"?? ERROR: $($Error[0]) (script line $($_.InvocationInfo.ScriptLineNumber))"
	exit 1
}

Specifies the word or sentence to get suggestions for.

An interactive directory of PowerShell scripts.