<?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>Hey, Scripting Guy! How Can I Supply More Than One Value from the Command Line?</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2009/06/30/hey-scripting-guy-how-can-i-supply-more-than-one-value-from-the-command-line.aspx</link><description>Hey, Scripting Guy! I do not think I write very complicated scripts, but quite often I find that it would be nice to be able to supply more than one value from the command line. It seems that everything I see written for Windows PowerShell uses the $args</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>re: Hey, Scripting Guy! How Can I Supply More Than One Value from the Command Line?</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2009/06/30/hey-scripting-guy-how-can-i-supply-more-than-one-value-from-the-command-line.aspx#3263833</link><pubDate>Tue, 14 Jul 2009 17:36:29 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3263833</guid><dc:creator>el_ingenio</dc:creator><description>&lt;p&gt;sorry guys, but in StringArgsArray1.ps1 you don't get any argument twice, as long as you don't repeat it in your output. Consider the following revised script:&lt;/p&gt;
&lt;p&gt;&amp;lt;b&amp;gt;arg_test.ps1&amp;lt;/b&amp;gt;&lt;/p&gt;
&lt;p&gt;$args | % { $_.GetType().FullName; $_ }&lt;/p&gt;
&lt;p&gt;when called with two strings, the output is as follows:&lt;/p&gt;
&lt;p&gt;PS &amp;gt; .\arg_test.ps1 a b&lt;/p&gt;
&lt;p&gt;System.String&lt;/p&gt;
&lt;p&gt;a&lt;/p&gt;
&lt;p&gt;System.String&lt;/p&gt;
&lt;p&gt;b&lt;/p&gt;
&lt;p&gt;it even works with more complex input:&lt;/p&gt;
&lt;p&gt;PS &amp;gt; .\arg_test.ps1 a b 1 [math]::pow(2,20)&lt;/p&gt;
&lt;p&gt;System.String&lt;/p&gt;
&lt;p&gt;a&lt;/p&gt;
&lt;p&gt;System.String&lt;/p&gt;
&lt;p&gt;b&lt;/p&gt;
&lt;p&gt;System.Int32&lt;/p&gt;
&lt;p&gt;1&lt;/p&gt;
&lt;p&gt;System.String&lt;/p&gt;
&lt;p&gt;[math]::pow&lt;/p&gt;
&lt;p&gt;System.Object[]&lt;/p&gt;
&lt;p&gt;2&lt;/p&gt;
&lt;p&gt;20&lt;/p&gt;
&lt;p&gt;PS &amp;gt;&lt;/p&gt;
&lt;p&gt;Please keep us posted about your shark adventures.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3263833" width="1" height="1"&gt;</description></item></channel></rss>