Skip to content

Instantly share code, notes, and snippets.

@Iristyle
Created April 5, 2013 17:03
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Iristyle/5320910 to your computer and use it in GitHub Desktop.
Save Iristyle/5320910 to your computer and use it in GitHub Desktop.
Powershell PING Redis
$client = New-Object Net.Sockets.TcpClient('localhost', 6379)
$stream = $client.GetStream()
$bytes = [Text.Encoding]::ASCII.GetBytes("PING`r`n")
$stream.Write($bytes, 0, $bytes.Length)
$buffer = New-Object byte[] 32
$read = $stream.Read($buffer, 0, 32)
$response = [Text.Encoding]::ASCII.GetChars($buffer) -join ''
Write-Host "Redis Response to PING: $response"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment