<?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>Reusing PowerShell Code—What is Best?</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2011/04/30/reusing-powershell-code-what-is-best.aspx</link><description>Summary : In this Weekend Scripter blog, Microsoft Scripting Guy, Ed Wilson, discusses considerations for code reuse. 
 Weekend Scripter 
 Microsoft Scripting Guy, Ed Wilson, is here. It has been really fun these past few weeks reviewing all of the</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>re: Reusing PowerShell Code—What is Best?</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2011/04/30/reusing-powershell-code-what-is-best.aspx#3502125</link><pubDate>Tue, 05 Jun 2012 15:02:24 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3502125</guid><dc:creator>IamMred</dc:creator><description>&lt;p&gt;@Kisquenet There are thousands (yes thousands) of sample PowerShell and VBScripts on the Scripting Guys Script Repository. Here is the link &lt;a rel="nofollow" target="_new" href="http://gallery.technet.microsoft.com/scriptcenter"&gt;gallery.technet.microsoft.com/scriptcenter&lt;/a&gt;&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3502125" width="1" height="1"&gt;</description></item><item><title>re: Reusing PowerShell Code—What is Best?</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2011/04/30/reusing-powershell-code-what-is-best.aspx#3501868</link><pubDate>Mon, 04 Jun 2012 10:12:24 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3501868</guid><dc:creator>kiquenet</dc:creator><description>&lt;p&gt;Any sample ps1 scripts about them ? thx&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3501868" width="1" height="1"&gt;</description></item><item><title>re: Reusing PowerShell Code—What is Best?</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2011/04/30/reusing-powershell-code-what-is-best.aspx#3425493</link><pubDate>Sat, 30 Apr 2011 21:48:34 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3425493</guid><dc:creator>Klaus Schulte</dc:creator><description>&lt;p&gt;P.S: I did notice, that you mentioned error handling before!&lt;/p&gt;
&lt;p&gt;But it should still be part of the guidelines.&lt;/p&gt;
&lt;p&gt;btw: Resuability depends on the clients your script is addressing.&lt;/p&gt;
&lt;p&gt;Reusability &amp;quot;just for me&amp;quot; or co-workers in my department is different from&lt;/p&gt;
&lt;p&gt;reusablilty for the enduser in a very different department.&lt;/p&gt;
&lt;p&gt;There are totally different requirements an issues involved if it comes to a handout to the end user.&lt;/p&gt;
&lt;p&gt;good night, Klaus&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3425493" width="1" height="1"&gt;</description></item><item><title>re: Reusing PowerShell Code—What is Best?</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2011/04/30/reusing-powershell-code-what-is-best.aspx#3425482</link><pubDate>Sat, 30 Apr 2011 21:24:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3425482</guid><dc:creator>Klaus Schulte</dc:creator><description>&lt;p&gt;Hello Ed,&lt;/p&gt;
&lt;p&gt;a wonderful intro to reusable code!&lt;/p&gt;
&lt;p&gt;The sentence in 4: &amp;quot;If I know I will never need the script again ...&amp;quot;&lt;/p&gt;
&lt;p&gt;is mostly the beginning of a long time or even everlasting friendship to the customer who said this!&lt;/p&gt;
&lt;p&gt;Just one point to add: &lt;/p&gt;
&lt;p&gt;5. lways include a generalized error reporting mechanism, if you don&amp;#39;t want to change your script each time an error occurs!&lt;/p&gt;
&lt;p&gt;This has to be part of reusability!&lt;/p&gt;
&lt;p&gt;Without that, you will always have to make changes to your script later on, if any errors occur!&lt;/p&gt;
&lt;p&gt;Inlcude it from the beginning on!&lt;/p&gt;
&lt;p&gt;kind regards, Klaus&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3425482" width="1" height="1"&gt;</description></item><item><title>re: Reusing PowerShell Code—What is Best?</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2011/04/30/reusing-powershell-code-what-is-best.aspx#3425435</link><pubDate>Sat, 30 Apr 2011 15:58:44 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3425435</guid><dc:creator>cseiter</dc:creator><description>&lt;p&gt;Now that I am part of twitter I can become better at scripting because of the audience. &amp;nbsp;When I was writing my code, I took reusable as &amp;quot;make it into a function that accepts everything as a variable that can be changed&amp;quot;. &amp;nbsp;I remember specifically one of my scripts would not work in a function but I kept trying to get it to work. &amp;nbsp;I ended up having to declare all the variables as global and make sure I nulled them out at the end of the script. &amp;nbsp;Way too much work to make it reusable, and I probably was using the wrong definition of reusable in the first place.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3425435" width="1" height="1"&gt;</description></item></channel></rss>