PoshCode Archive  Artifact [ec6778bfe2]

Artifact ec6778bfe20b5ea18d539672e23f8e33ca8e49c614e0db4114d46095f8eb5895:

  • File New-NamedPipe.ps1 — part of check-in [41a7c0df49] at 2018-06-10 14:26:14 on branch trunk — The below will create a bi-directional named pipe with the name you specify in the $pipeName variable. Note that .NET 3.5 is required for the System.IO.Pipes namespace. (user: unknown size: 630)

# encoding: ascii
# api: powershell
# title: New-NamedPipe
# description: The below will create a bi-directional named pipe with the name you specify in the $pipeName variable.  Note that .NET 3.5 is required for the System.IO.Pipes namespace.
# version: 3.5
# license: CC0
# x-poshcode-id: 898
# x-archived: 2009-03-03T09:49:38
#
#
# .NET 3.5 is required to use the System.IO.Pipes namespace
[reflection.Assembly]::LoadWithPartialName("system.core") | Out-Null
$pipeName = "pipename"
$pipeDir = [System.IO.Pipes.PipeDirection]::InOut
$pipe = New-Object system.IO.Pipes.NamedPipeServerStream( $pipeName, $pipeDir )