Let's say I have two PowerShell programs running: Producer.ps1
and Consumer.ps1
.
Is there any way to establish a client-server relationship between the two .ps1
files I have?
Specifically, Producer.ps1
outputs a PSObject
containing login info. Is there any way I can establish a listener and named pipe between the two objects to pass this PSObject
from Producer.ps1
directly into Consumer.ps1
?
(Note: the two files cannot be combined, because they each need to run as different Windows users. I know one possible solution for communicating is to write the PSObject
to a text/xml file, then have the client read and erase the file, but I'd rather not do this since it exposes the credentials. I'm open to whatever suggestions you have)