Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hey guys..
I am little bit shy of what am I asking for, but I have no experience in PowerShell language..

I am working on a project using C#.. where I need to read an output of "1 cmdlet" and pass this output as a parameter to another cmdlet...

I know it's easy to do using C#, but I am confuse about the whole "cmdlet" thin'.. and I don't know what to do..
any ideas how to do that ???
Posted
Comments
Otto Grunf 16-Oct-12 11:53am    
Could you post your code?

1 solution

Use the PowerShell class[^]? Use the AddCommand[^] method to add cmdlets to the processing pipeline.

See also: http://stackoverflow.com/questions/527513/execute-powershell-script-from-c-sharp-with-commandline-arguments[^], where you can see an other approach that uses runspace pipeline.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900