Created
December 12, 2020 12:18
-
-
Save scudette/b6a50f9756f58ed93c9f0f3bdcc01072 to your computer and use it in GitHub Desktop.
A named pipe client in powershell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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