<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://powershell.com/cs/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>Search results for '(app:forums OR groupid:24)' matching tags 'file', 'mail', 'loop', 'line', and 'output'</title><link>http://powershell.com/cs/search/SearchResults.aspx?q=(app:forums+OR+groupid:24)&amp;tag=file,mail,loop,line,output&amp;orTags=0&amp;o=DateDescending</link><description>Search results for '(app:forums OR groupid:24)' matching tags 'file', 'mail', 'loop', 'line', and 'output'</description><dc:language>en-US</dc:language><generator>CommunityServer 2008.5 (Build: 30929.2835)</generator><item><title>powershell for loop help</title><link>http://powershell.com/cs/forums/thread/9599.aspx</link><pubDate>Wed, 09 Mar 2011 06:00:00 GMT</pubDate><guid isPermaLink="false">f421715f-7aba-45f0-8a8d-44de5318a3a7:9599</guid><dc:creator>sftmb</dc:creator><description>&lt;p&gt;Hey Guys,&lt;/p&gt;
&lt;p&gt;I&amp;#39;m having some issues consructing the correct for loop I need and also finding a command to e-mail output. Maybe you guys can help me.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Currently I have a directory listing that has been parsed and stripped of everything except for the file name and dumped into a file called listing.txt. so, currently the file looks something like this:&lt;/p&gt;
&lt;p&gt;test1.txt&lt;/p&gt;
&lt;p&gt;test2.txt&lt;/p&gt;
&lt;p&gt;test3.txt&lt;/p&gt;
&lt;p&gt;Basically I&amp;#39;m trying to write a for loop that will read each line inside of listing.txt and run a get-content(or cat) for each line. I would then need it to take that output and send it as an e-mail so for example, If I were to write this in bash it would look something like the following:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;for line in `cat listing.txt`;do&lt;/p&gt;
&lt;p&gt;echo &amp;quot;$line&amp;quot; &amp;gt;&amp;gt; output.txt&lt;/p&gt;
&lt;p&gt;cat &amp;quot;$line&amp;quot; &amp;gt;&amp;gt; output.txt&lt;/p&gt;
&lt;p&gt;echo &amp;quot;&amp;quot; &amp;gt;&amp;gt; output.txt&lt;/p&gt;
&lt;p&gt;mail -s &amp;quot;this is a subject&amp;quot; test@yahoo.com &amp;lt; output.txt&lt;/p&gt;
&lt;p&gt;done&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Hopefully you guys can help me, as I&amp;#39;m totally new to powershell. Thanks alot!&lt;/p&gt;
&lt;p&gt;-Terrell&lt;/p&gt;</description></item></channel></rss>