I have a script that writes output to a log file and also the console. I am running the command Add-WindowsFeatures... I want to take output of this command and pipe it to my script. Is it possible?
Tell me more
×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.
Absolutely. You just need to include the CmdletBinding attribute on your param statement. Then, add an attribute to one of your parameters which details the way the pipeline input binds to the parameter. For instance put this in c:\temp\get-extension.ps1:
Then, you can do this:
updating to address the latest comment: I'm guessing that setting the parameter type to
in the process block will get you close. |
|||||
|