Skip to content

Instantly share code, notes, and snippets.

@kjunichi
Last active October 19, 2016 08:56
Show Gist options
  • Save kjunichi/4ec8671bd643969aad9b0645d714749b to your computer and use it in GitHub Desktop.
Save kjunichi/4ec8671bd643969aad9b0645d714749b to your computer and use it in GitHub Desktop.
2016/10/12

PowerShellで相手先のポートの空き状況を確認

Powershellでhttp

$webReq = [Net.HttpWebRequest]::Create("http://www.google.co.jp/search?hl=ja&q=$word")
$webReq.Method = "GET"
$webReq.UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.0.3705; .NET CLR 1.1.4322)"

$webRes = $webReq.GetResponse()
$sr = New-Object IO.StreamReader($webRes.GetResponseStream(), $webRes.ContentEncoding)
$content = $sr.ReadToEnd()
$sr.Close()
$webRes.Close()

関連

アクセス解析タグ

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment