<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.technet.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Build Your Own PowerShell Cmdlet: Part 7 of 9</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2012/10/05/build-your-own-powershell-cmdlet-part-7-of-9.aspx</link><description>Microsoft Windows PowerShell MVP, Sean Kearney, continues a series of guest blogs detailing building your own cmdlet.</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>re: Build Your Own PowerShell Cmdlet: Part 7 of 9</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2012/10/05/build-your-own-powershell-cmdlet-part-7-of-9.aspx#3526243</link><pubDate>Tue, 16 Oct 2012 07:04:56 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3526243</guid><dc:creator>rjcox</dc:creator><description>&lt;p&gt;&amp;gt; simply alter each passed parameter in the Process block with a [0] to reflect this.&lt;/p&gt;
&lt;p&gt;This means if the parameters are specified on the command line (not using the pipeline) the second etc. elements of those arrays will be ignored silently. Not good.&lt;/p&gt;
&lt;p&gt;The mistake is making the three parameters &amp;nbsp;($Folder, $Preface, and $Extension) arrays in the first place. For pipeline input they don&amp;#39;t need to be (compare Where-Object&amp;#39;s -InputValue: the parameter that receives Where-Object&amp;#39;s pipeline input is /not/ an array). As they all need to match up (what would happen if there were two prefaces but three folders and four extensions?) easier to avoid the arrays.&lt;/p&gt;
&lt;p&gt;(If using without the pipeline then the caller would need to do the looping over multiple sets of values, but that isn&amp;#39;t much of a loss.)&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3526243" width="1" height="1"&gt;</description></item></channel></rss>