<?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>Powershell again. Pipes, and &amp;quot;This is not an output&amp;quot;</title><link>http://blogs.technet.com/jamesone/archive/2007/08/28/powershell-again-pipes-and-this-is-not-an-output.aspx</link><description>My experiences with PowerShell continue and every so often realize that I never really understood something I thought I'd "got" some while back I've spent most of my time trying not to use the WRITE cmdlets to send output to the screen. After all if I</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>[BLOG POST] About the pipeline</title><link>http://blogs.technet.com/jamesone/archive/2007/08/28/powershell-again-pipes-and-this-is-not-an-output.aspx#1848807</link><pubDate>Tue, 28 Aug 2007 23:31:18 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:1848807</guid><dc:creator>Latest Newsgroup Posts</dc:creator><description>&lt;p&gt;[link] Marco&lt;/p&gt;</description></item><item><title>re: Powershell again. Pipes, and "This is not an output"</title><link>http://blogs.technet.com/jamesone/archive/2007/08/28/powershell-again-pipes-and-this-is-not-an-output.aspx#1851193</link><pubDate>Wed, 29 Aug 2007 07:06:46 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:1851193</guid><dc:creator>Jeffrey Snover</dc:creator><description>&lt;p&gt;I don't think you need a FOR loop to fix this, the OUT-HOST should suffice. &amp;nbsp;Just do &lt;/p&gt;
&lt;p&gt;Format-Table &amp;lt;blah blah&amp;gt; | Out-Host ;&lt;/p&gt;
&lt;p&gt;And you'll be all set. &amp;nbsp;By the way, when I ran this on my machine, I decided to add -AutoSize to the Format-Table - that is much nicer to deal with.&lt;/p&gt;
&lt;p&gt;Cheers!&lt;/p&gt;
&lt;p&gt;Jeffrey Snover [MSFT]&lt;/p&gt;
&lt;p&gt;Windows Management Partner Architect&lt;/p&gt;
&lt;p&gt;Visit the Windows PowerShell Team blog at: &amp;nbsp; &amp;nbsp;&lt;a rel="nofollow" target="_new" href="http://blogs.msdn.com/PowerShell"&gt;http://blogs.msdn.com/PowerShell&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Visit the Windows PowerShell ScriptCenter at: &amp;nbsp;&lt;a rel="nofollow" target="_new" href="http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx"&gt;http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx&lt;/a&gt;&lt;/p&gt;</description></item><item><title>re: Powershell again. Pipes, and "This is not an output"</title><link>http://blogs.technet.com/jamesone/archive/2007/08/28/powershell-again-pipes-and-this-is-not-an-output.aspx#1851269</link><pubDate>Wed, 29 Aug 2007 07:27:48 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:1851269</guid><dc:creator>Jeffrey Snover</dc:creator><description>&lt;p&gt;BTW - if you wanted to allow multiple processes to be chosen you could do this:&lt;/p&gt;
&lt;p&gt;$proc[ [int[]](Read-Host &amp;quot;Which ones? &amp;quot;).Split(&amp;quot;,&amp;quot;)]&lt;/p&gt;
&lt;p&gt;See if you like that.&lt;/p&gt;
&lt;p&gt;Jeffrey Snover [MSFT]&lt;/p&gt;
&lt;p&gt;Windows Management Partner Architect&lt;/p&gt;
&lt;p&gt;Visit the Windows PowerShell Team blog at: &amp;nbsp; &amp;nbsp;&lt;a rel="nofollow" target="_new" href="http://blogs.msdn.com/PowerShell"&gt;http://blogs.msdn.com/PowerShell&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Visit the Windows PowerShell ScriptCenter at: &amp;nbsp;&lt;a rel="nofollow" target="_new" href="http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx"&gt;http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Emitting Objects verses Outputting Text to the Screen</title><link>http://blogs.technet.com/jamesone/archive/2007/08/28/powershell-again-pipes-and-this-is-not-an-output.aspx#1851540</link><pubDate>Wed, 29 Aug 2007 08:19:29 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:1851540</guid><dc:creator>Noticias externas</dc:creator><description>&lt;p&gt;Let&amp;amp;#39;s face it, PowerShell does a bunch of magic for you. If we&amp;amp;#39;ve done our job right, this magic&lt;/p&gt;
</description></item><item><title>re: Powershell again. Pipes, and "This is not an output"</title><link>http://blogs.technet.com/jamesone/archive/2007/08/28/powershell-again-pipes-and-this-is-not-an-output.aspx#1854741</link><pubDate>Wed, 29 Aug 2007 18:12:03 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:1854741</guid><dc:creator>Matt Wilson</dc:creator><description>&lt;p&gt;This is really cool! &amp;nbsp;I've been wanting something like this for a while, but just haven't thought it out yet.&lt;/p&gt;
&lt;p&gt;After reviewing all the comments &amp;amp; having more time to think about it, do you have a &amp;quot;better version&amp;quot; written now that you can share with us? &amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;</description></item><item><title>re: Powershell again. Pipes, and "This is not an output"</title><link>http://blogs.technet.com/jamesone/archive/2007/08/28/powershell-again-pipes-and-this-is-not-an-output.aspx#1859664</link><pubDate>Thu, 30 Aug 2007 12:39:22 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:1859664</guid><dc:creator>jamesone</dc:creator><description>&lt;P&gt;Jeffrey, thanks for your comments and your kind words over on the Powershell team blog.&lt;/P&gt;
&lt;P&gt;Matt. The function would now go&lt;/P&gt;
&lt;P&gt;Function choose-process&lt;/P&gt;
&lt;P&gt;{$global:Counter=-1&lt;/P&gt;
&lt;P&gt;$proc=Get-Process&lt;/P&gt;
&lt;P&gt;Format-Table -autosize -inputobject $Proc @{ Label = "ID"; Expression={($global:counter++) }} , processName | out-host&lt;/P&gt;
&lt;P&gt;$proc[ [int[]](Read-Host "Which ones? ").Split(",")] }&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;note:&lt;/STRONG&gt; I've revised this comment to included Jeffery's multi-select - since I've just written something which actually uses it :-) &lt;/P&gt;</description></item><item><title>re: Powershell again. Pipes, and "This is not an output"</title><link>http://blogs.technet.com/jamesone/archive/2007/08/28/powershell-again-pipes-and-this-is-not-an-output.aspx#1893770</link><pubDate>Tue, 04 Sep 2007 13:33:13 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:1893770</guid><dc:creator>Hecks</dc:creator><description>&lt;p&gt;I have a set of such functions that basically do the equivalent of SHIFT/CTRL selecting from a list with a mouse. &amp;nbsp;The trick works with just about any Powershell output really. &amp;nbsp;Here's one for selecting directory items:&lt;/p&gt;
&lt;p&gt;-------------&lt;/p&gt;
&lt;p&gt;## Pick-ChildItem.ps1 ##&lt;/p&gt;
&lt;p&gt;param ($path, [array]$index, [switch]$force)&lt;/p&gt;
&lt;p&gt;if ($force) {$switch = &amp;quot;-force&amp;quot;}&lt;/p&gt;
&lt;p&gt;$global:items = (invoke-expression &amp;quot;get-childitem '$path\*' $switch&amp;quot; | &lt;/p&gt;
&lt;p&gt; &amp;nbsp; sort-object &amp;nbsp;@{expression={$_.PSIsContainer}; Descending=$true},&lt;/p&gt;
&lt;p&gt; &amp;nbsp; @{expression={$_.Name}; Ascending=$true})&lt;/p&gt;
&lt;p&gt;if ($index -ne $null) {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; $index | %{$_} | %{$items[$_ - 1]}&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;else {$items | %{$i=1}{$_; $i++} | &lt;/p&gt;
&lt;p&gt; &amp;nbsp; format-table @{label=&amp;quot;ID&amp;quot;; expression={$i}}, Name,&lt;/p&gt;
&lt;p&gt; &amp;nbsp; @{label=&amp;quot;Path&amp;quot;; expression={&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; if ($_.PSISContainer) {&amp;quot;&amp;lt;Dir&amp;gt; $_&amp;quot;} &lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; else {$_.directoryname}}} -auto&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;-------------&lt;/p&gt;
&lt;p&gt;usage:&lt;/p&gt;
&lt;p&gt;new-alias -name pci -value c:\Scripts\Pick-ChildItem.ps1&lt;/p&gt;
&lt;p&gt;pci . &amp;lt;- returns all items in current directory&lt;/p&gt;
&lt;p&gt;pci . 4 &amp;lt;- returns fourth item in list&lt;/p&gt;
&lt;p&gt;pci . (1..6),(47..50) &amp;lt;- returns all items in ID ranges&lt;/p&gt;</description></item><item><title>re: Powershell again. Pipes, and "This is not an output"</title><link>http://blogs.technet.com/jamesone/archive/2007/08/28/powershell-again-pipes-and-this-is-not-an-output.aspx#1897090</link><pubDate>Tue, 04 Sep 2007 23:30:25 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:1897090</guid><dc:creator>jamesone</dc:creator><description>&lt;p&gt;Fantastic Hecks. thanks for sharing. &lt;/p&gt;
</description></item><item><title>More tales from the weekend of PowerShell: a bit of a horror story</title><link>http://blogs.technet.com/jamesone/archive/2007/08/28/powershell-again-pipes-and-this-is-not-an-output.aspx#1950008</link><pubDate>Thu, 13 Sep 2007 18:41:16 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:1950008</guid><dc:creator>James O'Neill's blog </dc:creator><description>&lt;p&gt;I mentioned my weekend of PowerShell , and that I've been working on scripts for the Office Communications&lt;/p&gt;
</description></item><item><title>A little more on PowerShell</title><link>http://blogs.technet.com/jamesone/archive/2007/08/28/powershell-again-pipes-and-this-is-not-an-output.aspx#3048322</link><pubDate>Fri, 02 May 2008 01:27:32 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3048322</guid><dc:creator>James O'Neill's blog </dc:creator><description>&lt;p&gt;I've been showing PowerShell on the roadshow, and Steve warning me about it becoming the &amp;amp;quot;Look-how-clever-I-am-with-PowerShell&lt;/p&gt;
</description></item></channel></rss>