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:

 

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):

 

code snippet

$input | % { "data $_" }

 

 



Windows Server  >  Management



Comments

Popular posts from this blog

Motherboard replacement

Cannot create Full Text Search catalog after upgrading to V12 - Database is not fully started up or it is not in an ONLINE state

Remote Desktop App - Error 0x207 or 0x607