You need to use the right constructor, that property can't be set afterwards. This will do the trick:
$PipeSecurity = new-object System.IO.Pipes.PipeSecurity
$AccessRule = New-Object System.IO.Pipes.PipeAccessRule( "Users", "FullControl", "Allow" )
$PipeSecurity.AddAccessRule($AccessRule)
$pipe=new-object System.IO.Pipes.NamedPipeServerStream("p","In",100, "Byte", "Asynchronous", 32768, 32768, $PipeSecurity);