<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.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>Flexible pipelining with ScriptBlock Parameters</title><link>http://blogs.msdn.com/powershell/archive/2006/06/23/643674.aspx</link><description>PSMDTAG:FAQ: How can I pipeline data to a parameter which does not accept pipeline input? PSMDTAG:FAQ: What are ScriptBlock Parameters? One of the foundation concepts of Windows PowerShell is pipelining objects instead of text. What happens is that when</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: Flexible pipelining with ScriptBlock Parameters</title><link>http://blogs.msdn.com/powershell/archive/2006/06/23/643674.aspx#645065</link><pubDate>Sat, 24 Jun 2006 04:22:41 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:645065</guid><dc:creator>jvierra</dc:creator><description>Now that is going to come in very handy as we move along.&lt;br&gt;&lt;br&gt;PS amazes me more-an-more eac day. &amp;nbsp;Keep up the exceellent blogs Jeffery/PS-Team.&lt;br&gt;&lt;br&gt;</description></item><item><title>re: Flexible pipelining with ScriptBlock Parameters</title><link>http://blogs.msdn.com/powershell/archive/2006/06/23/643674.aspx#645765</link><pubDate>Sat, 24 Jun 2006 17:44:09 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:645765</guid><dc:creator>dontBotherMeWithSpam</dc:creator><description>I think you have forgotten to mention one of the most important(well in my personal opinion that is) that when you use &amp;quot;scriptblock parameter&amp;quot;, only one instance of cmdlet is run while one or more instances are run when using &amp;quot;foreach&amp;quot;... Did i get that correct?&lt;br&gt;&lt;br&gt;Ah, another one, I am not sure if I am remembering this correct that, there is a gotcha when it comes to passing a script block as a parameter that, you can't use scriptblock parameter on a parameter which accepts an object of type PSObject.(is it also a case for PSCustomObjects?)</description></item><item><title>re: Flexible pipelining with ScriptBlock Parameters</title><link>http://blogs.msdn.com/powershell/archive/2006/06/23/643674.aspx#646385</link><pubDate>Sun, 25 Jun 2006 07:59:55 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:646385</guid><dc:creator>PowerShellTeam</dc:creator><description>&amp;gt; &amp;nbsp;only one instance of cmdlet is run while one or more instances are run when using &amp;quot;foreach&amp;quot;... &lt;br&gt;&lt;br&gt;That is absolutely correct and you are also correct that this can be a critical difference. &amp;nbsp;Imagine the case where a Cmdlet opens a DB connections, puts each object into the DB and then closes the connection. &amp;nbsp;If this Cmdlet is in a foreach block - it will open and close the connection for every object where as using ScriptBlock parameters, you only have 1 instance of the Cmdlet so it opens and closes the connection once.&lt;br&gt;&lt;br&gt;Correct as well on the restriction. &amp;nbsp;Scriptblocks work on parameters which are not of type SCRIPTBLOCK or OBJECT. I haven't looked at the code but I don't believe that there is a problem with PSObject types. &amp;nbsp;&lt;br&gt;&lt;br&gt;Jeffrey Snover&lt;br&gt;Windows PowerShell Architect&lt;br&gt;</description></item><item><title>re: Flexible pipelining with ScriptBlock Parameters</title><link>http://blogs.msdn.com/powershell/archive/2006/06/23/643674.aspx#647375</link><pubDate>Mon, 26 Jun 2006 17:06:26 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:647375</guid><dc:creator>Boris Verkhovykh</dc:creator><description>Maybe not the right place for this question, but this is the most close topic to my current problem.&lt;br&gt;I have created own cmdlet, which works fine in the defautl PowerShell host. It accepts various parameters from command line and the &amp;quot;target&amp;quot; item names from the pipeline.&lt;br&gt;Now I am trying to create custom PS Host application. And here I cannot supply a list of &amp;quot;target&amp;quot; objects - I always get parameter binding exceptions.&lt;br&gt;SDK is almost empty... Could you help me?&lt;br&gt;</description></item><item><title>re: Flexible pipelining with ScriptBlock Parameters</title><link>http://blogs.msdn.com/powershell/archive/2006/06/23/643674.aspx#647538</link><pubDate>Mon, 26 Jun 2006 19:44:28 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:647538</guid><dc:creator>dontBotherMeWithSpam</dc:creator><description>&amp;gt; Imagine the case where a Cmdlet opens a DB connections, puts each object into the DB and then closes the connection&lt;br&gt;&lt;br&gt;Ah, now that's a case I have never though of where I could make use of this feature!&lt;br&gt;&lt;br&gt;Thank you for clearing up there and for the post, Jeffrey.&lt;br&gt;</description></item><item><title>Cmdlets vs. APIs</title><link>http://blogs.msdn.com/powershell/archive/2006/06/23/643674.aspx#3665745</link><pubDate>Tue, 03 Jul 2007 04:01:19 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3665745</guid><dc:creator>Windows PowerShell</dc:creator><description>&lt;p&gt;Some people have asked the question, &amp;quot;Why Cmdlets?&amp;quot;. If you already have a reasonable API, what is the&lt;/p&gt;
</description></item><item><title>Cmdlets vs. APIs</title><link>http://blogs.msdn.com/powershell/archive/2006/06/23/643674.aspx#3666070</link><pubDate>Tue, 03 Jul 2007 04:55:43 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3666070</guid><dc:creator>Noticias externas</dc:creator><description>&lt;p&gt;Some people have asked the question, &amp;amp;quot;Why Cmdlets?&amp;amp;quot;. If you already have a reasonable API,&lt;/p&gt;
</description></item><item><title>Tyler Byrd News  &amp;raquo; Blog Archive   &amp;raquo; Cmdlets vs. APIs</title><link>http://blogs.msdn.com/powershell/archive/2006/06/23/643674.aspx#5590718</link><pubDate>Mon, 22 Oct 2007 07:22:13 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5590718</guid><dc:creator>Tyler Byrd News  » Blog Archive   » Cmdlets vs. APIs</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://tylerczt.jordano.es/2007/10/22/cmdlets-vs-apis/"&gt;http://tylerczt.jordano.es/2007/10/22/cmdlets-vs-apis/&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>Uriah Smith  &amp;raquo; Blog Archive   &amp;raquo; Cmdlets vs. APIs</title><link>http://blogs.msdn.com/powershell/archive/2006/06/23/643674.aspx#7187138</link><pubDate>Mon, 21 Jan 2008 22:17:07 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7187138</guid><dc:creator>Uriah Smith  » Blog Archive   » Cmdlets vs. APIs</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://smithuriahdcj.breastbondagenewsank.com/2008/01/21/cmdlets-vs-apis/"&gt;http://smithuriahdcj.breastbondagenewsank.com/2008/01/21/cmdlets-vs-apis/&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>$MindWarpingPower = $Cmdlets + $ScriptBlock_Parameters</title><link>http://blogs.msdn.com/powershell/archive/2006/06/23/643674.aspx#8413173</link><pubDate>Mon, 21 Apr 2008 02:59:35 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8413173</guid><dc:creator>Windows PowerShell</dc:creator><description>&lt;p&gt;A while ago I blogged about the power of Flexible Pipeling Scriptblock parameters .&amp;amp;#160; The mechanics&lt;/p&gt;
</description></item><item><title>Easiest way to find aliases for a command? | keyongtech</title><link>http://blogs.msdn.com/powershell/archive/2006/06/23/643674.aspx#9363281</link><pubDate>Thu, 22 Jan 2009 08:37:58 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9363281</guid><dc:creator>Easiest way to find aliases for a command? | keyongtech</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://www.keyongtech.com/2831428-easiest-way-to-find-aliases"&gt;http://www.keyongtech.com/2831428-easiest-way-to-find-aliases&lt;/a&gt;&lt;/p&gt;
</description></item></channel></rss>