pepoluan
pepoluan

Reputation: 6808

VB.Net handle PowerShell pipe?

I'm not sure how to phrase the question, but this is what I'm looking for:

I want to create a VB.Net application that can 'insert' itself in a PowerShell pipe as receiver, and optionally also as a producer. In other words, I want to do this:

Some-PowerShell-CmdLet | My-Program

and optionally:

Some-PowerShell-CmdLet | My-Program | Other-PowerShell-CmdLet

I would very much appreciate it if you can point out the relevant documentations and/or tutorials.

Upvotes: 0

Views: 292

Answers (2)

SumitKhanna
SumitKhanna

Reputation: 44

You can directly execute the application "powershell Some-PowerShell-CmdLet | PATH/My-Program" from where Powershell will be installed. Also use following command from Windows to start a new powershell window as: "start powershell new-PSSession -Computername ${IPAddress} -Cred ${adminUser}\${VMUserName}"

Upvotes: 1

Mark Hall
Mark Hall

Reputation: 54552

Take a look at this MSDN Blog by David Aiken. It discusses getting the Visual Studio PowerShell Templates in C# and Vb.net and then gives a rundown on how to create a cmdlet.

You can also look at these tutorials from Microsoft.

Upvotes: 2

Related Questions