<?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' matching tags 'Remoting' and 'performance'</title><link>http://powershell.com/cs/search/SearchResults.aspx?q=app:forums&amp;tag=Remoting,performance&amp;orTags=0&amp;o=DateDescending</link><description>Search results for 'app:forums' matching tags 'Remoting' and 'performance'</description><dc:language>en-US</dc:language><generator>CommunityServer 2008.5 (Build: 30929.2835)</generator><item><title>Performance Difference between InvokeCommand and ImportSession</title><link>http://powershell.com/cs/forums/thread/8183.aspx</link><pubDate>Wed, 10 Nov 2010 06:00:00 GMT</pubDate><guid isPermaLink="false">f421715f-7aba-45f0-8a8d-44de5318a3a7:8183</guid><dc:creator>kumar</dc:creator><description>&lt;p&gt;I have a C# application that issues commands and scripts (1 or 2 liners) to an Exchange 2010 through remote powershell (Configuration &amp;quot;Microsoft.Exchange&amp;quot;). I found two ways to do this - create a remote session and then (a) using InvokeCommand on that session &amp;nbsp;with my scriptblock or (b) ImportSession and then running the commands/scripts on that shell. I understand the way the two options work, but my question is regarding the performance difference between these two options. I see that when I have a script with pipes (obviously) followed by select or foreach or similar, the network traffic is much higher in the ImportSession option. Is this expected? I would go for InvokeCommand, but my problem is that many of the basic script constructs (like where, foreach etc.) are not accepted in the script block. It reports &amp;#39;command not found error&amp;#39;. Any suggestions, advices?&lt;/p&gt;
&lt;p&gt;thanks,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kumar&lt;/p&gt;</description></item></channel></rss>