PowerShell functions can include a
Param block to gain more control over how they accept input. They can accept data from the pipeline by including a
ValueFromPipeline parameter, for example. I found, however, that this tends not to work well with arrays. The function gets an array containing a single element: the first one in the original array. Using
advanced functions could probably make accepting lists of things work better, but I found it easier to just accept the array as a normal parameter, which works as expected.
No comments:
Post a Comment