PowerShell: how to read Pipe.Input from a script?
btw: let me know if it's wrong forum? powershell forum?
i've integrated ps project , trying invoke script, but, before hand, i'd populate new pipeline data script can process it, but, after writing pipeline, can't access script. how do this?
here host code snippet:
foreach (psobject obj in inputpipeline) { pipeline.input.write(obj); } pipeline.input.close(); outputpipeline = pipeline.invoke(); foreach (psobject result in outputpipeline) { // .... stuff here }
and list of different command permutations i've tried run (let's want print input items):
$input | % "data: $_"
% "data: $_"
"data: $_"
nothing worked. ideas?
yep. was afraid so.
actually, recently, i've found out problem (i'm not sure why i've missed it).
the problem in script, should (curly brackets missing):
$input | % { "data $_" }
Windows Server > Management
Comments
Post a Comment