<?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>PowerTip: Find and Import Modules</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2012/08/23/powertip-find-and-import-modules.aspx</link><description>Learn how to find and import Windows PowerShell modules.</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>re: PowerTip: Find and Import Modules</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2012/08/23/powertip-find-and-import-modules.aspx#3516136</link><pubDate>Fri, 24 Aug 2012 14:34:24 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3516136</guid><dc:creator>Matheus Kamphorst</dc:creator><description>&lt;p&gt;basic but essential&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3516136" width="1" height="1"&gt;</description></item><item><title>re: PowerTip: Find and Import Modules</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2012/08/23/powertip-find-and-import-modules.aspx#3516122</link><pubDate>Fri, 24 Aug 2012 13:18:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3516122</guid><dc:creator>Walid Toumi</dc:creator><description>&lt;p&gt;@Ed&lt;/p&gt;
&lt;p&gt;1- i use &amp;quot;New-Module&amp;quot; with &amp;quot;AsCustomObject&amp;quot; parameter to convert my dynamic modules into objects members and make their use simple&lt;/p&gt;
&lt;p&gt;PS II&amp;gt;&lt;/p&gt;
&lt;p&gt;$objMod=New-Module -Name DynamicModule -Script {&lt;/p&gt;
&lt;p&gt; function hello { b $args[0] }&lt;/p&gt;
&lt;p&gt; function b($name) { write &amp;quot;hello $name&amp;quot; }&lt;/p&gt;
&lt;p&gt;} -function hello | Import-Module -PassThru -Verbose -AsCustomObject&lt;/p&gt;
&lt;p&gt;PS II&amp;gt; $objMod.hello(&amp;quot;$env:username&amp;quot;)&lt;/p&gt;
&lt;p&gt;2- i use &amp;quot;New-Module&amp;quot; because is in memory not in disk and much easier to quickly group functions in memory and make them as a unit&lt;/p&gt;
&lt;p&gt;(sorry for my english)&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3516122" width="1" height="1"&gt;</description></item><item><title>re: PowerTip: Find and Import Modules</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2012/08/23/powertip-find-and-import-modules.aspx#3516116</link><pubDate>Fri, 24 Aug 2012 12:18:34 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3516116</guid><dc:creator>Ed Wilson</dc:creator><description>&lt;p&gt;@Walid Toumi that is a great tip thank you for sharing it. Let me ask you, how would you use a dynamic module? When does it make sense to you to do this?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3516116" width="1" height="1"&gt;</description></item><item><title>re: PowerTip: Find and Import Modules</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2012/08/23/powertip-find-and-import-modules.aspx#3516110</link><pubDate>Fri, 24 Aug 2012 11:34:14 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3516110</guid><dc:creator>Walid Toumi</dc:creator><description>&lt;p&gt;Hi Ed,&lt;/p&gt;
&lt;p&gt;you can also import dynamic modules:&lt;/p&gt;
&lt;p&gt;PS II&amp;gt; &amp;nbsp;New-Module -Name DynamicModule -Script {&lt;/p&gt;
&lt;p&gt; &amp;nbsp;function hello { b $args[0] }&lt;/p&gt;
&lt;p&gt; &amp;nbsp;function b($name) { write &amp;quot;hello $name&amp;quot; }&lt;/p&gt;
&lt;p&gt;} -function hello | Import-Module -PassThru -Verbose&lt;/p&gt;
&lt;p&gt;PS II&amp;gt; hello $env:USERNAME&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3516110" width="1" height="1"&gt;</description></item></channel></rss>