Skip to content

Instantly share code, notes, and snippets.

@scudette
Created December 12, 2020 12:18
Show Gist options
  • Save scudette/b6a50f9756f58ed93c9f0f3bdcc01072 to your computer and use it in GitHub Desktop.
Save scudette/b6a50f9756f58ed93c9f0f3bdcc01072 to your computer and use it in GitHub Desktop.
A named pipe client in powershell
$npipeClient = new-object System.IO.Pipes.NamedPipeClientStream(".", 'BlackJack', [System.IO.Pipes.PipeDirection]::InOut,
[System.IO.Pipes.PipeOptions]::None,
[System.Security.Principal.TokenImpersonationLevel]::Impersonation)
$npipeClient.Connect()
$script:pipeWriter = new-object System.IO.StreamWriter($npipeClient)
$pipeWriter.AutoFlush = $true
while (1) {
$pipeWriter.WriteLine("hello")
Sleep 1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment