<?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>Power and Pith</title><link>http://blogs.msdn.com/powershell/archive/2006/10/21/Power-and-Pith.aspx</link><description>In our newsgroup, Benny asked the question, “How to get subdir items with full path name?” ClaudioG64 responded: PS&amp;gt; get-childitem C:\ | foreach-object -process { $_.FullName } Dreeschkind replied that we had pithier ways of doing it posting: PS&amp;gt;</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: Power and Pith</title><link>http://blogs.msdn.com/powershell/archive/2006/10/21/Power-and-Pith.aspx#855801</link><pubDate>Sun, 22 Oct 2006 17:41:38 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:855801</guid><dc:creator>Borat</dc:creator><description>&lt;p&gt;I like!&lt;/p&gt;</description></item><item><title>re: Power and Pith</title><link>http://blogs.msdn.com/powershell/archive/2006/10/21/Power-and-Pith.aspx#863110</link><pubDate>Mon, 23 Oct 2006 18:26:31 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:863110</guid><dc:creator>Julian Kay</dc:creator><description>&lt;p&gt;I like it! Thank you!&lt;/p&gt;</description></item><item><title>re: Power and Pith</title><link>http://blogs.msdn.com/powershell/archive/2006/10/21/Power-and-Pith.aspx#864875</link><pubDate>Mon, 23 Oct 2006 21:43:57 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:864875</guid><dc:creator>Stefan</dc:creator><description>&lt;p&gt;Why don't you use &amp;quot;gci c:\ | select-object fullname&amp;quot; ?&lt;/p&gt;</description></item><item><title>re: Power and Pith</title><link>http://blogs.msdn.com/powershell/archive/2006/10/21/Power-and-Pith.aspx#872889</link><pubDate>Wed, 25 Oct 2006 16:55:15 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:872889</guid><dc:creator>jachymko</dc:creator><description>&lt;p&gt;Stefan, you don't want to use select-object because it returns a collection of PSCustomObjects, each one with a FullName property. &lt;/p&gt;
&lt;p&gt;This function returns only the actual values of the property (eg. strings, ints, not wrapped in a PSCustomObject)&lt;/p&gt;</description></item><item><title>re: Power and Pith</title><link>http://blogs.msdn.com/powershell/archive/2006/10/21/Power-and-Pith.aspx#877180</link><pubDate>Thu, 26 Oct 2006 21:43:44 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:877180</guid><dc:creator>Andrew</dc:creator><description>&lt;p&gt;I tried your suggestion, i.e., ${function:...} and I get errors. &amp;nbsp;What is wrong? &amp;nbsp;This is RC2 of the powershell running in XPSP2. &amp;nbsp;See below...&lt;/p&gt;
&lt;p&gt;Windows PowerShell&lt;/p&gt;
&lt;p&gt;Copyright (C) 2006 Microsoft Corporation. All rights reserved.&lt;/p&gt;
&lt;p&gt;PS U:\&amp;gt; ${function:...} = { process { $_.($args[0]) } }&lt;/p&gt;
&lt;p&gt;PS U:\&amp;gt; gci c:\ | _ FullName&lt;/p&gt;
&lt;p&gt;The term '_' is not recognized as a cmdlet, function, operable program, or script file. Verify the term and try again.&lt;/p&gt;
&lt;p&gt;At line:1 char:12&lt;/p&gt;
&lt;p&gt;+ gci c:\ | _ &amp;nbsp;&amp;lt;&amp;lt;&amp;lt;&amp;lt; FullName&lt;/p&gt;
&lt;p&gt;PS U:\&amp;gt; gci c:\ | _FullName&lt;/p&gt;
&lt;p&gt;The term '_FullName' is not recognized as a cmdlet, function, operable program, or script file. Verify the term and try&lt;/p&gt;
&lt;p&gt; again.&lt;/p&gt;
&lt;p&gt;At line:1 char:19&lt;/p&gt;
&lt;p&gt;+ gci c:\ | _FullName &amp;lt;&amp;lt;&amp;lt;&amp;lt;&lt;/p&gt;
&lt;p&gt;PS U:\&amp;gt; gci c:\ | FullName&lt;/p&gt;
&lt;p&gt;The term 'FullName' is not recognized as a cmdlet, function, operable program, or script file. Verify the term and try&lt;/p&gt;
&lt;p&gt;again.&lt;/p&gt;
&lt;p&gt;At line:1 char:18&lt;/p&gt;
&lt;p&gt;+ gci c:\ | FullName &amp;lt;&amp;lt;&amp;lt;&amp;lt;&lt;/p&gt;</description></item><item><title>re: Power and Pith</title><link>http://blogs.msdn.com/powershell/archive/2006/10/21/Power-and-Pith.aspx#878432</link><pubDate>Fri, 27 Oct 2006 11:38:52 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:878432</guid><dc:creator>David</dc:creator><description>&lt;p&gt;Andrew: try using a real name for the function (replace &amp;quot;...&amp;quot; with something useful :)&lt;/p&gt;</description></item><item><title>re: Power and Pith</title><link>http://blogs.msdn.com/powershell/archive/2006/10/21/Power-and-Pith.aspx#883391</link><pubDate>Fri, 27 Oct 2006 22:56:25 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:883391</guid><dc:creator>Marcel</dc:creator><description>&lt;p&gt;I like to use the name pick, however, &amp;quot;...&amp;quot; works just fine. &amp;nbsp;The problem Andrew is having isn't because he's using &amp;quot;...&amp;quot; as the name. &amp;nbsp;The problem is he's creating a function called &amp;quot;...&amp;quot; but in his tests he's using &amp;quot;_&amp;quot; instead.&lt;/p&gt;</description></item><item><title>re: Power and Pith</title><link>http://blogs.msdn.com/powershell/archive/2006/10/21/Power-and-Pith.aspx#885670</link><pubDate>Sat, 28 Oct 2006 01:33:08 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:885670</guid><dc:creator>Jamie</dc:creator><description>&lt;p&gt;I had two questions about this function:&lt;/p&gt;
&lt;p&gt;1. What are the rules for non-alphanumeric function names? &amp;nbsp;I tried creating a function !! to give me the last command line (like csh), but I can't seem to overload the !.&lt;/p&gt;
&lt;p&gt;2. In the function body is the command 'process', which appears to be shorthand (not an alias) for get-process. &amp;nbsp;I see the same functionality for the noun 'item', but not for 'object'. &amp;nbsp;What are these and how do the work?&lt;/p&gt;
&lt;p&gt;Pretty cool stuff!&lt;/p&gt;</description></item><item><title>re: Power and Pith</title><link>http://blogs.msdn.com/powershell/archive/2006/10/21/Power-and-Pith.aspx#889698</link><pubDate>Sat, 28 Oct 2006 17:49:31 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:889698</guid><dc:creator>John</dc:creator><description>&lt;p&gt;Jamie, &lt;/p&gt;
&lt;p&gt;!! seems to have some special meaning, though I'm not sure what it is. &amp;nbsp;$$ is the variable for getting the last command that was run, though.&lt;/p&gt;
&lt;p&gt;As for the process {} bit, this mimics the Process() method in a cmdlet. &amp;nbsp;What that means is that whatever's passed along the pipeline will get passed to the process part of the function. &amp;nbsp;begin {} and end {} are called before the first item is processed, and after the last item respectively.&lt;/p&gt;</description></item><item><title>re: Power and Pith</title><link>http://blogs.msdn.com/powershell/archive/2006/10/21/Power-and-Pith.aspx#889802</link><pubDate>Sat, 28 Oct 2006 19:06:21 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:889802</guid><dc:creator>PowerShellTeam</dc:creator><description>&lt;P&gt;! is a synonym for the -not operator:&lt;/P&gt;
&lt;P&gt;PS (1) &amp;gt; ! $true&lt;/P&gt;
&lt;P&gt;False&lt;/P&gt;
&lt;P&gt;PS (2) &amp;gt; !! $true&lt;/P&gt;
&lt;P&gt;True&lt;/P&gt;
&lt;P&gt;PS (3) &amp;gt; -not &amp;nbsp;$true&lt;/P&gt;
&lt;P&gt;False&lt;/P&gt;
&lt;P&gt;PS (4) &amp;gt; -not -not &amp;nbsp;$true&lt;/P&gt;
&lt;P&gt;True&lt;/P&gt;
&lt;P&gt;You can define a function called !!&lt;/P&gt;
&lt;P&gt;PS (5) &amp;gt; function !! { "Hi" }&lt;/P&gt;
&lt;P&gt;but you have to use the call operator '&amp;amp;' to call it:&lt;/P&gt;
&lt;P&gt;PS (6) &amp;gt; &amp;amp; !!&lt;/P&gt;
&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;-bruce&lt;/P&gt;
&lt;P&gt;=========================================================&lt;/P&gt;
&lt;P&gt;Bruce Payette&lt;/P&gt;
&lt;P&gt;Windows PowerShell Technical Lead&lt;/P&gt;</description></item><item><title>re: Power and Pith</title><link>http://blogs.msdn.com/powershell/archive/2006/10/21/Power-and-Pith.aspx#889828</link><pubDate>Sat, 28 Oct 2006 19:23:54 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:889828</guid><dc:creator>John</dc:creator><description>&lt;p&gt;Hi Bruce,&lt;/p&gt;
&lt;p&gt;I thought it'd be something like that but a quick scan of about_operator didn't reveal it. &amp;nbsp;I just checked about_logical_operator, and it's mentioned there. &amp;nbsp;It's nice that the ! operator is kept from C#, though I note that &amp;amp;&amp;amp; and || aren't kept (for rather obvious reasons, I'd guess).&lt;/p&gt;
&lt;p&gt;(Eagerly awaiting your book, by the way! &amp;nbsp;I'd have signed up for early access, but I already ordered it from Amazon.co.uk, and I like having the physical book)&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;John&lt;/p&gt;</description></item><item><title>re: Power and Pith</title><link>http://blogs.msdn.com/powershell/archive/2006/10/21/Power-and-Pith.aspx#1380970</link><pubDate>Fri, 29 Dec 2006 23:17:51 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1380970</guid><dc:creator>MikeL</dc:creator><description>&lt;p&gt;I just started with PowerShell.&lt;/p&gt;
&lt;p&gt;Wanted to run some test scripts from you download.&lt;/p&gt;
&lt;p&gt;When I tpye in Beep.ps1 I get &amp;quot;The term 'Beep.1' is not recognized.....&amp;quot;&lt;/p&gt;
&lt;p&gt;What Am I doing wrong?&lt;/p&gt;</description></item><item><title>re: Power and Pith</title><link>http://blogs.msdn.com/powershell/archive/2006/10/21/Power-and-Pith.aspx#1381442</link><pubDate>Sat, 30 Dec 2006 01:19:26 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1381442</guid><dc:creator>PowerShellTeam</dc:creator><description>&lt;p&gt;&amp;gt; When I tpye in Beep.ps1 I get &amp;quot;The term 'Beep.1' is not recognized.....&amp;quot;&lt;/p&gt;
&lt;p&gt;&amp;gt; What Am I doing wrong?&lt;/p&gt;
&lt;p&gt;You are relying upon a traditional bad shell behaviour that has been a security nightmere for decades.&lt;/p&gt;
&lt;p&gt;In PowerShell, you have to be explicit if you want to run a command in the current directory. &amp;nbsp;Type &amp;quot;.\beep.ps1&amp;quot;&lt;/p&gt;
&lt;p&gt;Jeffrey Snover [MSFT]&lt;/p&gt;
&lt;p&gt;Windows PowerShell/MMC 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: Power and Pith</title><link>http://blogs.msdn.com/powershell/archive/2006/10/21/Power-and-Pith.aspx#1865770</link><pubDate>Mon, 12 Mar 2007 18:38:36 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1865770</guid><dc:creator>StitchJones</dc:creator><description>&lt;p&gt;Thank You for supplying the &amp;quot;.\*&amp;quot; information. &amp;nbsp;I have been racking my brain for almost two days wondering what I was doing wrong. &amp;nbsp;And to think it was as simple as using the PROPER .\yourscripthere.ps1 format.&lt;/p&gt;
&lt;p&gt;Thank you very very much.&lt;/p&gt;</description></item></channel></rss>