<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" xml:lang="en" xml:base="http://blog.usepowershell.com/wp-atom.php">
	<title type="text">Use PowerShell</title>
	<subtitle type="text">Real Admins Script</subtitle>

	<updated>2010-02-26T18:46:21Z</updated>
	<generator uri="http://wordpress.org/" version="2.9.2">WordPress</generator>

	<link rel="alternate" type="text/html" href="http://blog.usepowershell.com" />
	<id>http://blog.usepowershell.com/feed/atom/</id>
	

			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/UsePowershell" /><feedburner:info uri="usepowershell" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry>
		<author>
			<name>Steven Murawski</name>
						<uri>http://www.usepowershell.com</uri>
					</author>
		<title type="html"><![CDATA[Wisconsin Virtual SQL Server Lunch and Learn]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/UsePowershell/~3/do44hwSALGU/" />
		<id>http://blog.usepowershell.com/2010/02/wisconsin-virtual-sql-server-lunch-and-learn/</id>
		<updated>2010-02-26T18:46:21Z</updated>
		<published>2010-02-26T18:46:21Z</published>
		<category scheme="http://blog.usepowershell.com" term="General" />		<summary type="html"><![CDATA[I just finished taking up 13 people’s lunch hour to talk a bit about PowerShell V2, SQL Server, and the admin development model.
I want to thank John Allman and the Wisconsin SQL Server User Group for allowing me the time to share a bit about PowerShell.&#160; I believe John will be posting the recording for [...]]]></summary>
		<content type="html" xml:base="http://blog.usepowershell.com/2010/02/wisconsin-virtual-sql-server-lunch-and-learn/">&lt;p&gt;I just finished taking up 13 people’s lunch hour to talk a bit about &lt;a href="http://msdn.microsoft.com/en-us/library/ms714418(VS.85).aspx" target="_blank"&gt;PowerShell&lt;/a&gt; V2, SQL Server, and the &lt;a href="http://blogs.msdn.com/powershell/archive/2007/01/01/the-admin-development-model-and-send-snippet.aspx" target="_blank"&gt;admin development model&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I want to thank &lt;a href="http://wisconsin.sqlpass.org/" target="_blank"&gt;John Allman and the Wisconsin SQL Server User Group&lt;/a&gt; for allowing me the time to share a bit about PowerShell.&amp;#160; I believe John will be posting the recording for those who are interested.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://download.usepowershell.com/PowerShellV2.pptx" target="_blank"&gt;My slide deck is available here.&lt;/a&gt;&amp;#160; The slides aren’t worth much, but the resources on the last two are where the real meat is.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Tzeo7dzDZpuLpmJ2mDt5Z2qPJbI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Tzeo7dzDZpuLpmJ2mDt5Z2qPJbI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Tzeo7dzDZpuLpmJ2mDt5Z2qPJbI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Tzeo7dzDZpuLpmJ2mDt5Z2qPJbI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/UsePowershell?a=do44hwSALGU:e1rkjxtyzSI:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/UsePowershell?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/UsePowershell/~4/do44hwSALGU" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://blog.usepowershell.com/2010/02/wisconsin-virtual-sql-server-lunch-and-learn/#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://blog.usepowershell.com/2010/02/wisconsin-virtual-sql-server-lunch-and-learn/feed/atom/" thr:count="0" />
		<thr:total>0</thr:total>
	<feedburner:origLink>http://blog.usepowershell.com/2010/02/wisconsin-virtual-sql-server-lunch-and-learn/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Steven Murawski</name>
						<uri>http://www.usepowershell.com</uri>
					</author>
		<title type="html"><![CDATA[Deep Fried PowerShell]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/UsePowershell/~3/sAXWJZlLS6U/" />
		<id>http://blog.usepowershell.com/?p=176</id>
		<updated>2010-02-26T16:50:15Z</updated>
		<published>2010-02-26T16:09:59Z</published>
		<category scheme="http://blog.usepowershell.com" term="General" />		<summary type="html"><![CDATA[Back in August, I was offered a chance to make a fool of myself on yet another podcast tremendously honored by the opportunity to talk with Keith Elder and Chris “Woody” Woodruff on their podcast – Deep Fried Bytes – about PowerShell.
Keith and Chris are great guys, very sharp, and asked some good questions.&#160; If [...]]]></summary>
		<content type="html" xml:base="http://blog.usepowershell.com/2010/02/deep-fried-powershell/">&lt;p&gt;Back in August, I was &lt;strike&gt;offered a chance to make a fool of myself on yet another podcast&lt;/strike&gt; tremendously honored by &lt;a href="http://deepfriedbytes.com/podcast/episode-46-using-powershell-to-be-more-productive-with-steven-murawski/" target="_blank"&gt;the opportunity&lt;/a&gt; to talk with &lt;a href="http://keithelder.net/blog/" target="_blank"&gt;Keith Elder&lt;/a&gt; and &lt;a href="http://chriswoodruff.com/" target="_blank"&gt;Chris “Woody” Woodruff&lt;/a&gt; on their podcast – &lt;a href="http://deepfriedbytes.com/" target="_blank"&gt;Deep Fried Bytes&lt;/a&gt; – about &lt;a href="http://msdn.microsoft.com/en-us/library/ms714418(VS.85).aspx" target="_blank"&gt;PowerShell&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Keith and Chris are great guys, very sharp, and asked some good questions.&amp;#160; If you pop over to take a listen to my appearance, make sure to go back and take a look through their archives.&amp;#160; They’ve got 45 other shows, all worthwhile.&amp;#160; (I’m a few podcast behind.. still working through &lt;a href="http://deepfriedbytes.com/podcast/episode-37-the-present-and-future-of-workflow-foundation-with-brian-noyes-part-1/" target="_blank"&gt;show #37&lt;/a&gt; – where they are talking about Windows Workflow.&amp;#160; Jut to pull in some PowerShell, there is a PowerShell Activity in WF 4.)&amp;#160; I’m quite looking forward to &lt;a href="http://deepfriedbytes.com/podcast/episode-44-soft-skills-every-developer-needs-with-brian-prince/" target="_blank"&gt;show #44 on soft skills&lt;/a&gt; with &lt;a href="http://brianhprince.com/" target="_blank"&gt;Brian Prince&lt;/a&gt;, as I don’t think we in the tech fields focus enough on these.&lt;/p&gt;
&lt;p&gt;If you want to hear more on PowerShell related development, send Keith and Woody some feedback on the show or bother your favorite podcaster to do a show on PowerShell – maybe they’ll ask you to put your Shell where your mouth is…&lt;/p&gt;
&lt;p&gt;&lt;a href="http://deepfriedbytes.com/podcast/episode-46-using-powershell-to-be-more-productive-with-steven-murawski/" target="_blank"&gt;Check out the show here..&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/j86AuyU7OHaKn1H5FcG-_uAFmWw/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/j86AuyU7OHaKn1H5FcG-_uAFmWw/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/j86AuyU7OHaKn1H5FcG-_uAFmWw/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/j86AuyU7OHaKn1H5FcG-_uAFmWw/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/UsePowershell?a=sAXWJZlLS6U:7TZzGCZy-Ts:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/UsePowershell?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/UsePowershell/~4/sAXWJZlLS6U" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://blog.usepowershell.com/2010/02/deep-fried-powershell/#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://blog.usepowershell.com/2010/02/deep-fried-powershell/feed/atom/" thr:count="0" />
		<thr:total>0</thr:total>
	<feedburner:origLink>http://blog.usepowershell.com/2010/02/deep-fried-powershell/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Steven Murawski</name>
						<uri>http://www.usepowershell.com</uri>
					</author>
		<title type="html"><![CDATA[Greater Milwaukee Script Club &#8211; Take 2]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/UsePowershell/~3/pGQ9SDGa444/" />
		<id>http://blog.usepowershell.com/2010/01/greater-milwaukee-script-club-take-2/</id>
		<updated>2010-01-27T14:25:06Z</updated>
		<published>2010-01-27T14:25:06Z</published>
		<category scheme="http://blog.usepowershell.com" term="General" />		<summary type="html"><![CDATA[We had a pretty good turnout for the first Greater Milwaukee Script Club and a lot of interest in keeping it going, so I’ve set up a home page for the group on Joel “Jaykul” Bennet’s PowerShellGroup.Org site, which serves as a portal page for PowerShell user groups.
Rod Gabriel (who heads up our local VMWare [...]]]></summary>
		<content type="html" xml:base="http://blog.usepowershell.com/2010/01/greater-milwaukee-script-club-take-2/">&lt;p&gt;We had a pretty good turnout for the first Greater Milwaukee Script Club and a lot of interest in keeping it going, so I’ve set up a &lt;a href="http://powershellgroup.org/milwaukee.wi" target="_blank"&gt;home page for the group&lt;/a&gt; on &lt;a href="http://huddledmasses.org" target="_blank"&gt;Joel “Jaykul” Bennet’s&lt;/a&gt; PowerShellGroup.Org site, which serves as a portal page for PowerShell user groups.&lt;/p&gt;
&lt;p&gt;Rod Gabriel (who heads up our local VMWare User Group) &lt;a href="http://www.wivmug.org/2010/01/my-first-scripting-club-meeting/" target="_blank"&gt;has an excellent review of the event.&lt;/a&gt;&amp;#160; He covers why he considered attending (including why learning PowerShell was becoming a priority for him), as well as the event itself.&lt;/p&gt;
&lt;p&gt;Registration is available for our next meeting – which will be February 16th at 6:00 PM at the Greenfield Municipal Court (&lt;a href="http://mkescriptclub.eventbrite.com/" target="_blank"&gt;details here&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;More details and information to follow..&lt;/p&gt;

&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Oxhk9vrKQgpUtUWaeOmWn5vOXB4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Oxhk9vrKQgpUtUWaeOmWn5vOXB4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Oxhk9vrKQgpUtUWaeOmWn5vOXB4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Oxhk9vrKQgpUtUWaeOmWn5vOXB4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/UsePowershell?a=pGQ9SDGa444:prjRCr9z0RU:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/UsePowershell?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/UsePowershell/~4/pGQ9SDGa444" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://blog.usepowershell.com/2010/01/greater-milwaukee-script-club-take-2/#comments" thr:count="3" />
		<link rel="replies" type="application/atom+xml" href="http://blog.usepowershell.com/2010/01/greater-milwaukee-script-club-take-2/feed/atom/" thr:count="3" />
		<thr:total>3</thr:total>
	<feedburner:origLink>http://blog.usepowershell.com/2010/01/greater-milwaukee-script-club-take-2/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Steven Murawski</name>
						<uri>http://www.usepowershell.com</uri>
					</author>
		<title type="html"><![CDATA[Script Injection with Set-PSBreakpoint]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/UsePowershell/~3/seWhajSKDn0/" />
		<id>http://blog.usepowershell.com/2010/01/script-injection-with-set-psbreakpoint/</id>
		<updated>2010-01-12T20:30:05Z</updated>
		<published>2010-01-12T20:15:06Z</published>
		<category scheme="http://blog.usepowershell.com" term="General" /><category scheme="http://blog.usepowershell.com" term="PowerShell" /><category scheme="http://blog.usepowershell.com" term="PowerShell Version 2" />		<summary type="html"><![CDATA[I’ve used the integrated debugging features with PowerShell V2 since I’ve had it available, but I never really dug below the surface of setting breakpoints at certain lines.
Set-PSBreakpoint offers some additional options of which I was not aware.

Setting a breakpoint in relation to a variable (read, assigned, or both) 
Setting a breakpoint when a function [...]]]></summary>
		<content type="html" xml:base="http://blog.usepowershell.com/2010/01/script-injection-with-set-psbreakpoint/">&lt;p&gt;I’ve used the integrated debugging features with &lt;a href="http://support.microsoft.com/kb/968929" target="_blank"&gt;PowerShell V2&lt;/a&gt; since I’ve had it available, but I never really dug below the surface of setting breakpoints at certain lines.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://technet.microsoft.com/en-us/library/dd315264.aspx" target="_blank"&gt;Set-PSBreakpoint&lt;/a&gt; offers some additional options of which I was not aware.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Setting a breakpoint in relation to a variable (read, assigned, or both)&lt;/strong&gt; &lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Setting a breakpoint when a function or command is called&lt;/strong&gt; &lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Setting a breakpoint based on the column number for the referenced line&lt;/strong&gt; &lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Run a scriptblock when a breakpoint is hit&lt;/strong&gt; &lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Breakpoints do not need to be set on a script&lt;/strong&gt; &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Let’s dig into these in a bit more detail:&lt;/p&gt;
&lt;h3&gt;1.  Setting a breakpoint in relation to a variable (read, assigned, or both)&lt;/h3&gt;
&lt;p&gt;Set-PSBreakpoint can be used to find all the occurrences of access to a variable (in the current scope).  This can be very useful when attempting to find out where things might be taking an unexpected turn with your variable’s contents.&lt;/p&gt;
&lt;h3&gt;2. Setting a breakpoint when a function or command is called&lt;/h3&gt;
&lt;p&gt;This is cool.  You can configure breakpoints based on when cmdlets or functions are called.  Great stopping at the entry point to a particularly troublesome function, so you can drop into the debugger and check the state of parameters about to go in, as well as other state related issues.&lt;/p&gt;
&lt;h3&gt;3. Setting a breakpoint based on the column number for the referenced line&lt;/h3&gt;
&lt;p&gt;I’m not so stoked about this feature.  This merely allows you to specify which column to stop execution on in a particular line of code…  Moderately useful, but not really exciting.&lt;/p&gt;
&lt;h3&gt;4. Run a scriptblock when a breakpoint is hit&lt;/h3&gt;
&lt;p&gt;This is where things get interesting.  You can assign an action to occur when a breakpoint is hit.  This action is a scriptblock that is run in the scope where it is set.  Since breakpoints can be variable assignments or calls to commands, this opens up some interesting possibilities.  First off, it allows for conditional debugging.  If you only want to drop into a breakpoint if a particular value is less than zero before going into a function, you could do something like&lt;/p&gt;
&lt;pre class="PowerShellColorizedScript"&gt;&lt;span style="color: #ff4500"&gt;$BreakpointAction&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #000000"&gt;{&lt;/span&gt;
    &lt;span style="color: #00008b"&gt;if&lt;/span&gt; &lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #ff4500"&gt;$MyNumber&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;-lt&lt;/span&gt; &lt;span style="color: #800080"&gt;0&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;/span&gt;
    &lt;span style="color: #000000"&gt;{&lt;/span&gt;
        &lt;span style="color: #00008b"&gt;break&lt;/span&gt;
    &lt;span style="color: #000000"&gt;}&lt;/span&gt;
    &lt;span style="color: #00008b"&gt;else&lt;/span&gt;
    &lt;span style="color: #000000"&gt;{&lt;/span&gt;
        &lt;span style="color: #00008b"&gt;continue&lt;/span&gt;
    &lt;span style="color: #000000"&gt;}&lt;/span&gt;
&lt;span style="color: #000000"&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This also has applications outside of debugging.  Using the –Action parameter of Set-PSBreakpoint, you have the ability to run a scripblock of your choosing at any of the condition types described above – when variables are accessed, when commands are called, and at certain specific positions in the script.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;h3&gt;5. Breakpoints do not need to be set on a script&lt;/h3&gt;
&lt;p&gt;Finally, breakpoints do not need to be set in a script, they can just be set to respond to variable access or command use.  This means that you could use Set-PSBreakpoint in a profile script to configure a particular environment to respond in a certain way, perhaps prompting you before changing a critical environmental variable.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;I’m definitely going to be exploring these additional features and applications of Set-PSBreakpoint as I go forward. &lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.msdn.com/powershell/archive/2009/07/13/advanced-debugging-in-powershell.aspx" target="_blank"&gt;Additional debugging tips/info from the PowerShell Team Blog.&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Please leave a comment as to how you think this functionality could be used.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/_Bz-K8KkyqcPovefMnO_GOjGqMk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/_Bz-K8KkyqcPovefMnO_GOjGqMk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/_Bz-K8KkyqcPovefMnO_GOjGqMk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/_Bz-K8KkyqcPovefMnO_GOjGqMk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/UsePowershell?a=seWhajSKDn0:56ZYJ2lPM3E:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/UsePowershell?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/UsePowershell/~4/seWhajSKDn0" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://blog.usepowershell.com/2010/01/script-injection-with-set-psbreakpoint/#comments" thr:count="1" />
		<link rel="replies" type="application/atom+xml" href="http://blog.usepowershell.com/2010/01/script-injection-with-set-psbreakpoint/feed/atom/" thr:count="1" />
		<thr:total>1</thr:total>
	<feedburner:origLink>http://blog.usepowershell.com/2010/01/script-injection-with-set-psbreakpoint/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Steven Murawski</name>
						<uri>http://www.usepowershell.com</uri>
					</author>
		<title type="html"><![CDATA[I&#8217;ll be on the PowerScripting Podcast!]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/UsePowershell/~3/1atEKFCqAu4/" />
		<id>http://blog.usepowershell.com/?p=164</id>
		<updated>2010-01-11T16:39:33Z</updated>
		<published>2010-01-11T16:39:33Z</published>
		<category scheme="http://blog.usepowershell.com" term="General" />		<summary type="html"><![CDATA[I&#8217;ll be on the PowerScripting podcast with Jonathan Walz and Hal Rottenberg for this week&#8217;s live stream. 
We&#8217;ll be talking about PowerShellCommunity.Org, the Sync Framework, and more&#8230;
I love that podcast and am really looking forward to it! 
Also, they recently posted an interview with Clint Huffman, who is the author of PAL.  Good stuff!
]]></summary>
		<content type="html" xml:base="http://blog.usepowershell.com/2010/01/ill-be-on-the-powerscripting-podcast/">&lt;p&gt;&lt;a href="http://powerscripting.wordpress.com/2010/01/11/this-thursday-steven-murawski-talks-about-powershellcommunity-org-and-more/" target="_blank"&gt;I&amp;#8217;ll be on the PowerScripting podcast with Jonathan Walz and Hal Rottenberg for this week&amp;#8217;s live stream&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;We&amp;#8217;ll be talking about PowerShellCommunity.Org, the Sync Framework, and more&amp;#8230;&lt;/p&gt;
&lt;p&gt;I love that podcast and am really looking forward to it! &lt;/p&gt;
&lt;p&gt;Also, they recently posted &lt;a href="http://powerscripting.wordpress.com/2010/01/10/episode-97-clint-huffman-and-his-pal-project/" target="_blank"&gt;an interview &lt;/a&gt;with &lt;a href="http://blogs.technet.com/clinth/" target="_blank"&gt;Clint Huffman&lt;/a&gt;, who is the author of &lt;a href="http://pal.codeplex.com" target="_blank"&gt;PAL&lt;/a&gt;.  Good stuff!&lt;/p&gt;

&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/D9mHq3x_Z4i5L2hFlVw9rTXecnU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/D9mHq3x_Z4i5L2hFlVw9rTXecnU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/D9mHq3x_Z4i5L2hFlVw9rTXecnU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/D9mHq3x_Z4i5L2hFlVw9rTXecnU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/UsePowershell?a=1atEKFCqAu4:4VI_qhwWMVo:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/UsePowershell?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/UsePowershell/~4/1atEKFCqAu4" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://blog.usepowershell.com/2010/01/ill-be-on-the-powerscripting-podcast/#comments" thr:count="1" />
		<link rel="replies" type="application/atom+xml" href="http://blog.usepowershell.com/2010/01/ill-be-on-the-powerscripting-podcast/feed/atom/" thr:count="1" />
		<thr:total>1</thr:total>
	<feedburner:origLink>http://blog.usepowershell.com/2010/01/ill-be-on-the-powerscripting-podcast/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Steven Murawski</name>
						<uri>http://www.usepowershell.com</uri>
					</author>
		<title type="html"><![CDATA[Script Club &#8211; Coming to the Greater Milwaukee Area]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/UsePowershell/~3/KUCgYPa0uFc/" />
		<id>http://blog.usepowershell.com/2009/12/script-club-coming-to-the-greater-milwaukee-area/</id>
		<updated>2009-12-08T17:41:50Z</updated>
		<published>2009-12-08T16:06:39Z</published>
		<category scheme="http://blog.usepowershell.com" term="General" /><category scheme="http://blog.usepowershell.com" term="PowerShell" /><category scheme="http://blog.usepowershell.com" term="PowerShell Community" /><category scheme="http://blog.usepowershell.com" term="PowerShell Version 1" /><category scheme="http://blog.usepowershell.com" term="PowerShell Version 2" />		<summary type="html"><![CDATA[Register here.
About PowerShell Script Club
1. You Always Talk About Script club    2. You Always Talk About Script Club     3. If Someone asks for Help, And You Can Help, You Help     4. Two People Help One Person at One Time     5. [...]]]></summary>
		<content type="html" xml:base="http://blog.usepowershell.com/2009/12/script-club-coming-to-the-greater-milwaukee-area/">&lt;h3&gt;&lt;strong&gt;&lt;a href="http://mkescriptclub.eventbrite.com " target="_blank"&gt;Register here.&lt;/a&gt;&lt;/strong&gt;&lt;/h3&gt;
&lt;h3&gt;About PowerShell Script Club&lt;/h3&gt;
&lt;p&gt;1. You Always Talk About Script club    &lt;br /&gt;2. You Always Talk About Script Club     &lt;br /&gt;3. If Someone asks for Help, And You Can Help, You Help     &lt;br /&gt;4. Two People Help One Person at One Time     &lt;br /&gt;5. One Module Per Person Per Night     &lt;br /&gt;6. All Scripts, All PowerShell     &lt;br /&gt;7. Scripts will be as short as they can be     &lt;br /&gt;8. If This is your First time at Script Club, You Have to Script&lt;/p&gt;
&lt;h4&gt;The first Greater Milwaukee &lt;a href="http://msdn.microsoft.com/en-us/library/ms714418(VS.85).aspx" target="_blank"&gt;PowerShell&lt;/a&gt; Script Club is being formed.&lt;/h4&gt;
&lt;p&gt;The first meeting will be on Tuesday, January 19th at 6:00 PM at the Greenfield Law Enforcement Center (in the Municipal Court Room), 5300 W Layton Ave, Greenfield, WI&amp;#160; 53220.&amp;#160; &lt;a href="http://mkescriptclub.eventbrite.com " target="_blank"&gt;Register here.&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;u&gt;All&lt;/u&gt;&lt;/strong&gt; &lt;strong&gt;IT Professionals (sysadmins, network admins, developers, help desk, and all others) with &lt;u&gt;any level of experience&lt;/u&gt; are welcome.&amp;#160; If you DO NOT KNOW POWERSHELL, but you WANT TO – This is the place.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Pizza and soda will be provided, but please bring a laptop with PowerShell installed (version 1 or 2 is fine).&lt;/p&gt;
&lt;h4&gt;What is a Script Club?&lt;/h4&gt;
&lt;p&gt;&lt;a href="http://get-powershell.com/2009/04/04/powershell-script-club-in-seattle/" target="_blank"&gt;Andy Schneider describes a script club:&lt;/a&gt;&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;Script Clubs are like a hands on lab with no set topic or teacher. You bring an idea for a script, and ask your fellow PowerShell users for help getting the script written.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This is not a lecture or presentation based group (though we may have presentations from time to time).&amp;#160; Script Club is focused on creating working scripts that will help you get your work done or just enjoy yourself.&lt;/p&gt;
&lt;h3&gt;&lt;a href="http://mkescriptclub.eventbrite.com/" target="_blank"&gt;Register here.&lt;/a&gt;&lt;/h3&gt;

&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/RXi9facq6dwe9-m2_Q3OYDLTuWM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/RXi9facq6dwe9-m2_Q3OYDLTuWM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/RXi9facq6dwe9-m2_Q3OYDLTuWM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/RXi9facq6dwe9-m2_Q3OYDLTuWM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/UsePowershell?a=KUCgYPa0uFc:qUb4K6-LCpA:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/UsePowershell?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/UsePowershell/~4/KUCgYPa0uFc" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://blog.usepowershell.com/2009/12/script-club-coming-to-the-greater-milwaukee-area/#comments" thr:count="6" />
		<link rel="replies" type="application/atom+xml" href="http://blog.usepowershell.com/2009/12/script-club-coming-to-the-greater-milwaukee-area/feed/atom/" thr:count="6" />
		<thr:total>6</thr:total>
	<feedburner:origLink>http://blog.usepowershell.com/2009/12/script-club-coming-to-the-greater-milwaukee-area/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Steven Murawski</name>
						<uri>http://www.usepowershell.com</uri>
					</author>
		<title type="html"><![CDATA[Using the Sync Framework from PowerShell]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/UsePowershell/~3/VCA7sHWAaGw/" />
		<id>http://blog.usepowershell.com/2009/11/using-the-sync-framework-from-powershell/</id>
		<updated>2010-01-21T20:30:27Z</updated>
		<published>2009-11-13T14:11:50Z</published>
		<category scheme="http://blog.usepowershell.com" term=".NET Framework" /><category scheme="http://blog.usepowershell.com" term="PowerShell" /><category scheme="http://blog.usepowershell.com" term="PowerShell Version 2" /><category scheme="http://blog.usepowershell.com" term="Scripts" /><category scheme="http://blog.usepowershell.com" term="Sync Framework" />		<summary type="html"><![CDATA[I’ve been exploring the Sync Framework for use in a couple of projects I have going and PowerShell is my preferred exploratory environment.
It was a bit of fun, since I got to work with eventing for the first time in V2.
First, I downloaded the Sync Framework Software Development Kit.  That provided me with the Sync [...]]]></summary>
		<content type="html" xml:base="http://blog.usepowershell.com/2009/11/using-the-sync-framework-from-powershell/">&lt;p&gt;I’ve been exploring the &lt;a href="http://msdn.microsoft.com/en-us/sync/default.aspx" target="_blank"&gt;Sync Framework&lt;/a&gt; for use in a couple of projects I have going and &lt;a href="http://msdn.microsoft.com/en-us/library/ms714418(VS.85).aspx" target="_blank"&gt;PowerShell&lt;/a&gt; is my preferred exploratory environment.&lt;/p&gt;
&lt;p&gt;It was a bit of fun, since I got to work with eventing for the first time in V2.&lt;/p&gt;
&lt;p&gt;First, I downloaded the &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=89adbb1e-53ff-41b5-ba17-8e43a2e66254&amp;amp;displaylang=en" target="_blank"&gt;Sync Framework Software Development Kit&lt;/a&gt;.  That provided me with the Sync Framework runtime as well as some documentation.&lt;/p&gt;
&lt;p&gt;The easiest way for me to get started was to take one &lt;a href="http://msdn.microsoft.com/en-us/library/ee617386(SQL.105).aspx" target="_blank"&gt;of the samples&lt;/a&gt; and convert that to PowerShell.&lt;/p&gt;
&lt;p&gt;I’m going to walk along the MSDN Sample and provide the equivalent PowerShell, as well as any changes I made to make it feel more PowerShell-y.&lt;/p&gt;
&lt;h3&gt;Setting Synchronization Options&lt;/h3&gt;
&lt;p&gt;We are working with the File Sync Provider First up is setting the &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.synchronization.files.filesyncoptions(SQL.105).aspx" target="_blank"&gt;FileSyncOptions&lt;/a&gt;.  FileSyncOptions are an enumeration (a limited list defined in code that maps to certain values) whose values are controlled by setting the appropriate bits to indicate the presence or absence of a flag.  &lt;a href="http://twitter.com/meson3902" target="_blank"&gt;Mark Schill&lt;/a&gt; has &lt;a href="http://www.cmschill.net/stringtheory/2009/05/02/bitwise-operators/" target="_blank"&gt;a great post about how to set bitwise operations&lt;/a&gt;.&lt;/p&gt;
&lt;pre class="PowerShellColorizedScript"&gt;&lt;span style="color: #ff4500"&gt;$options &lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;= &lt;/span&gt;&lt;span style="color: #008080"&gt;[Microsoft.Synchronization.Files.FileSyncOptions]&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;::&lt;/span&gt;&lt;span style="color: #000000"&gt;ExplicitDetectChanges&lt;/span&gt;
&lt;span style="color: #ff4500"&gt;$options&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$options&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;-bor&lt;/span&gt; &lt;span style="color: #008080"&gt;[Microsoft.Synchronization.Files.FileSyncOptions]&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;::&lt;/span&gt;&lt;span style="color: #000000"&gt;RecycleDeletedFiles&lt;/span&gt;
&lt;span style="color: #ff4500"&gt;$options&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$options&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;-bor&lt;/span&gt; &lt;span style="color: #008080"&gt;[Microsoft.Synchronization.Files.FileSyncOptions]&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;::&lt;/span&gt;&lt;span style="color: #000000"&gt;RecyclePreviousFileOnUpdates&lt;/span&gt;
&lt;span style="color: #ff4500"&gt;$options&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$options&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;-bor&lt;/span&gt; &lt;span style="color: #008080"&gt;[Microsoft.Synchronization.Files.FileSyncOptions]&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;::&lt;/span&gt;&lt;span style="color: #000000"&gt;RecycleConflictLoserFiles&lt;/span&gt;&lt;/pre&gt;
&lt;h3&gt;Specifying a Static Filter&lt;/h3&gt;
&lt;p&gt;With the &lt;a href="http://msdn.microsoft.com/en-us/library/bb902860(SQL.105).aspx" target="_blank"&gt;File System provider,&lt;/a&gt; we can provide filters to include or exclude files and directories.&lt;/p&gt;
&lt;p&gt;$FileNameFilter and $SubdirectoryNameFilter are parameters that take strings or string arrays.&lt;/p&gt;
&lt;pre class="PowerShellColorizedScript"&gt;&lt;span style="color: #ff4500"&gt;$filter&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #0000ff"&gt;New-Object&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;Microsoft.Synchronization.Files.FileSyncScopeFilter&lt;/span&gt;
&lt;span style="color: #00008b"&gt;if&lt;/span&gt; &lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #ff4500"&gt;$FileNameFilter&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;count&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;-gt&lt;/span&gt; &lt;span style="color: #800080"&gt;0&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;/span&gt;
&lt;span style="color: #000000"&gt;{&lt;/span&gt;
   &lt;span style="color: #ff4500"&gt;$FileNameFilter&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;|&lt;/span&gt; &lt;span style="color: #0000ff"&gt;ForEach-Object&lt;/span&gt; &lt;span style="color: #000000"&gt;{&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$filter&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;FileNameExcludes&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;Add&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #ff4500"&gt;$_&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;/span&gt; &lt;span style="color: #000000"&gt;}&lt;/span&gt;
&lt;span style="color: #000000"&gt;}&lt;/span&gt;
&lt;span style="color: #00008b"&gt;if&lt;/span&gt; &lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #ff4500"&gt;$SubdirectoryNameFilter&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;count&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;-gt&lt;/span&gt; &lt;span style="color: #800080"&gt;0&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;/span&gt;
&lt;span style="color: #000000"&gt;{&lt;/span&gt;
   &lt;span style="color: #ff4500"&gt;$SubdirectoryNameFilter&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;|&lt;/span&gt; &lt;span style="color: #0000ff"&gt;ForEach-Object&lt;/span&gt; &lt;span style="color: #000000"&gt;{&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$filter&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;SubdirectoryExcludes&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;Add&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #ff4500"&gt;$_&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;/span&gt; &lt;span style="color: #000000"&gt;}&lt;/span&gt;
&lt;span style="color: #000000"&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;h3&gt;Performing Change Detection&lt;/h3&gt;
&lt;p&gt;After configuring the filter, we examine the folders and files located at the paths specified.  If there has not been any previous synchronization, a metadata file will be created in each location to track any changes, updates, and deletes for later synchronization.&lt;/p&gt;
&lt;pre class="PowerShellColorizedScript"&gt;&lt;span style="color: #00008b"&gt;function&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;Get-FileSystemChange&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;/span&gt;
&lt;span style="color: #000000"&gt;{&lt;/span&gt;
    &lt;span style="color: #00008b"&gt;param&lt;/span&gt; &lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #ff4500"&gt;$path&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;,&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$filter&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;,&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$options&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;/span&gt;
    &lt;span style="color: #00008b"&gt;try&lt;/span&gt;
    &lt;span style="color: #000000"&gt;{&lt;/span&gt;
        &lt;span style="color: #ff4500"&gt;$provider&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #0000ff"&gt;new-object&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;Microsoft.Synchronization.Files.FileSyncProvider&lt;/span&gt; &lt;span style="color: #000080"&gt;-ArgumentList&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$path&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;,&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$filter&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;,&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$options&lt;/span&gt;
        &lt;span style="color: #ff4500"&gt;$provider&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;DetectChanges&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;/span&gt;
    &lt;span style="color: #000000"&gt;}&lt;/span&gt;
    &lt;span style="color: #00008b"&gt;finally&lt;/span&gt;
    &lt;span style="color: #000000"&gt;{&lt;/span&gt;
        &lt;span style="color: #00008b"&gt;if&lt;/span&gt; &lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #ff4500"&gt;$provider&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;-ne&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$null&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;/span&gt;
        &lt;span style="color: #000000"&gt;{&lt;/span&gt;
            &lt;span style="color: #ff4500"&gt;$provider&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;Dispose&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;/span&gt;
        &lt;span style="color: #000000"&gt;}&lt;/span&gt;
    &lt;span style="color: #000000"&gt;}&lt;/span&gt;
&lt;span style="color: #000000"&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;
&lt;pre class="PowerShellColorizedScript"&gt;&lt;span style="color: #0000ff"&gt;Get-FileSystemChange&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$SourcePath&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$filter&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$options&lt;/span&gt;
&lt;span style="color: #0000ff"&gt;Get-FileSystemChange&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$DestinationPath&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$filter&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$options&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;
&lt;h3&gt;Handling Conflicts&lt;/h3&gt;
&lt;p&gt;Conflict resolution in the Sync Framework happens at the at the event level.  An event is merely something that happens that can trigger other actions.  Using &lt;a href="http://technet.microsoft.com/en-us/library/dd347672.aspx" target="_blank"&gt;Register-ObjectEvent&lt;/a&gt;, we can associate one or more scriptblocks with an event.&lt;/p&gt;
&lt;p&gt;First, I defined scriptblocks to handle the conflicts.  There is an enumeration, the &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.synchronization.conflictresolutionaction(SQL.105).aspx" target="_blank"&gt;ConflictResolutionAction&lt;/a&gt; enumeration, that provides some options for dealing with conflicts.  For this example, we are going to pick the source object as the winner for any conflicts.&lt;/p&gt;
&lt;p&gt;You will also notice another type of conflict defined, and that is a Constraint conflict.  That can occur when an object of the same name is added on both sides in between synchronizations.  The resolution options for these conflicts can be found in the &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.synchronization.constraintconflictresolutionaction(SQL.105).aspx" target="_blank"&gt;ConstraintConflictResolutionAction&lt;/a&gt; enumeration.&lt;/p&gt;
&lt;pre class="PowerShellColorizedScript"&gt;&lt;span style="color: #ff4500"&gt;$ItemConflictAction&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt;   &lt;span style="color: #000000"&gt;{&lt;/span&gt;
    &lt;span style="color: #ff4500"&gt;$event&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;SourceEventArgs&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;SetResolutionAction&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #008080"&gt;[Microsoft.Synchronization.ConflictResolutionAction]&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;::&lt;/span&gt;&lt;span style="color: #000000"&gt;SourceWins&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;/span&gt;
    &lt;span style="color: #008080"&gt;[string[]]&lt;/span&gt;&lt;span style="color: #ff4500"&gt;$global:FileSyncReport&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;Conflicted&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;+=&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$event&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;SourceEventArgs&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;DestinationChange&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;ItemId&lt;/span&gt;
&lt;span style="color: #000000"&gt;}&lt;/span&gt;
&lt;span style="color: #ff4500"&gt;$ItemConstraintAction&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #000000"&gt;{&lt;/span&gt;
     &lt;span style="color: #ff4500"&gt;$event&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;SourceEventArgs&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;SetResolutionAction&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #008080"&gt;[Microsoft.Synchronization.ConstraintConflictResolutionAction]&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;::&lt;/span&gt;&lt;span style="color: #000000"&gt;SourceWins&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;/span&gt;
     &lt;span style="color: #008080"&gt;[string[]]&lt;/span&gt;&lt;span style="color: #ff4500"&gt;$global:FileSyncReport&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;Constrained&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;+=&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$event&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;SourceEventArgs&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;DestinationChange&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;ItemId&lt;/span&gt;
&lt;span style="color: #000000"&gt;}&lt;/span&gt;            

&lt;span style="color: #006400"&gt;# Configure the events for conflicts or constraints for the source and destination providers&lt;/span&gt;
&lt;span style="color: #ff4500"&gt;$destinationCallbacks&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$destinationProvider&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;DestinationCallbacks&lt;/span&gt;
&lt;span style="color: #0000ff"&gt;Register-ObjectEvent&lt;/span&gt; &lt;span style="color: #000080"&gt;-InputObject&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$destinationCallbacks&lt;/span&gt; &lt;span style="color: #000080"&gt;-EventName&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;ItemConflicting&lt;/span&gt; &lt;span style="color: #000080"&gt;-Action&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$ItemConflictAction&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;|&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Out-Null&lt;/span&gt;
&lt;span style="color: #0000ff"&gt;Register-ObjectEvent&lt;/span&gt; &lt;span style="color: #000080"&gt;-InputObject&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$destinationCallbacks&lt;/span&gt; &lt;span style="color: #000080"&gt;-EventName&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;ItemConstraint&lt;/span&gt; &lt;span style="color: #000080"&gt;-Action&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$ItemConstraintAction&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;|&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Out-Null&lt;/span&gt;            

&lt;span style="color: #ff4500"&gt;$sourceCallbacks&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$SourceProvider&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;DestinationCallbacks&lt;/span&gt;
&lt;span style="color: #0000ff"&gt;Register-ObjectEvent&lt;/span&gt; &lt;span style="color: #000080"&gt;-InputObject&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$sourceCallbacks&lt;/span&gt; &lt;span style="color: #000080"&gt;-EventName&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;ItemConflicting&lt;/span&gt; &lt;span style="color: #000080"&gt;-Action&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$ItemConflictAction&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;|&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Out-Null&lt;/span&gt;
&lt;span style="color: #0000ff"&gt;Register-ObjectEvent&lt;/span&gt; &lt;span style="color: #000080"&gt;-InputObject&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$sourceCallbacks&lt;/span&gt; &lt;span style="color: #000080"&gt;-EventName&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;ItemConstraint&lt;/span&gt; &lt;span style="color: #000080"&gt;-Action&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$ItemConstraintAction&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;|&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Out-Null&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;We also see for the first time in the script blocks a variable called $event.  This is an automatic variable exposed by the event and provides us information that we can use in our action.&lt;/p&gt;
&lt;p&gt;Finally, I’m updating a variable in the global scope.  There probably is a better way to handle this, but scriptblocks executed in response to events only have access to the global scope and any of the automatic variable exposed to it.  Therefore, I use a variable in the global scope to gather my reporting information.&lt;/p&gt;
&lt;h3&gt;Synchronizing Two Replicas&lt;/h3&gt;
&lt;p&gt;To start to synchronize the two sides, first we set up the synchronization via a &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.synchronization.syncorchestrator.aspx" target="_blank"&gt;SyncOrchestrator&lt;/a&gt; and assign it the local and remote providers, as well as defining the direction of the synchronization.  In this example (sticking with the format from MSDN, we will do an Upload, which is in the &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.synchronization.syncdirectionorder.aspx" target="_blank"&gt;SyncDirectionOrder enumeration&lt;/a&gt; (other options are Download, DownloadAndUpload, and UploadAndDownload). &lt;/p&gt;
&lt;pre class="PowerShellColorizedScript"&gt;&lt;span style="color: #006400"&gt;# Create the agent that will perform the file sync&lt;/span&gt;
&lt;span style="color: #ff4500"&gt;$agent&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #0000ff"&gt;New-Object&lt;/span&gt;  &lt;span style="color: #8a2be2"&gt;Microsoft.Synchronization.SyncOrchestrator&lt;/span&gt;
&lt;span style="color: #ff4500"&gt;$agent&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;LocalProvider&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$sourceProvider&lt;/span&gt;
&lt;span style="color: #ff4500"&gt;$agent&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;RemoteProvider&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$destinationProvider&lt;/span&gt;            

&lt;span style="color: #006400"&gt;# Upload changes from the source to the destination.&lt;/span&gt;
&lt;span style="color: #ff4500"&gt;$agent&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;Direction&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #008080"&gt;[Microsoft.Synchronization.SyncDirectionOrder]&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;::&lt;/span&gt;&lt;span style="color: #000000"&gt;Upload&lt;/span&gt;            

&lt;span style="color: #0000ff"&gt;Write-Host&lt;/span&gt; &lt;span style="color: #8b0000"&gt;"Synchronizing changes from $($sourceProvider.RootDirectoryPath) to replica: $($destinationProvider.RootDirectoryPath)"&lt;/span&gt;
&lt;span style="color: #ff4500"&gt;$agent&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;Synchronize&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;/span&gt;&lt;span style="color: #000000"&gt;;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;To achieve two way synchronization, we will do the upload twice, reversing the order of the providers.&lt;/p&gt;
&lt;pre class="PowerShellColorizedScript"&gt;&lt;span style="color: #0000ff"&gt;Invoke-OneWayFileSync&lt;/span&gt; &lt;span style="color: #000080"&gt;-SourcePath&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$SourcePath&lt;/span&gt; &lt;span style="color: #000080"&gt;-DestinationPath&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$DestinationPath&lt;/span&gt; &lt;span style="color: #000080"&gt;-Filter&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$null&lt;/span&gt; &lt;span style="color: #000080"&gt;-Options&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$options&lt;/span&gt;
&lt;span style="color: #0000ff"&gt;Invoke-OneWayFileSync&lt;/span&gt; &lt;span style="color: #000080"&gt;-SourcePath&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$DestinationPath&lt;/span&gt; &lt;span style="color: #000080"&gt;-DestinationPath&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$SourcePath&lt;/span&gt; &lt;span style="color: #000080"&gt;-Filter&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$null&lt;/span&gt; &lt;span style="color: #000080"&gt;-Options&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$options&lt;/span&gt;&lt;/pre&gt;
&lt;h3&gt;Full Example&lt;/h3&gt;
&lt;p&gt;I modified the example to write out a custom object (and the logging is in the variable in the global scope as noted in the Handling Conflicts section) with the results of the synchronization (rather than logging it to the console).&lt;/p&gt;
&lt;p&gt;In all, my translation is pretty similar to the example code, but there are some differences. &lt;/p&gt;
&lt;pre class="PowerShellColorizedScript"&gt;&lt;span style="color: #006400"&gt;# Requires -Version 2&lt;/span&gt;
&lt;span style="color: #006400"&gt;# Also depends on having the Microsoft Sync Framework 2.0 SDK or Runtime&lt;/span&gt;
&lt;span style="color: #006400"&gt;# --SDK--&lt;/span&gt;
&lt;span style="color: #006400"&gt;# http://www.microsoft.com/downloads/details.aspx?FamilyID=89adbb1e-53ff-41b5-ba17-8e43a2e66254&amp;amp;displaylang=en&lt;/span&gt;
&lt;span style="color: #006400"&gt;# --Runtime--&lt;/span&gt;
&lt;span style="color: #006400"&gt;# http://www.microsoft.com/downloads/details.aspx?FamilyId=109DB36E-CDD0-4514-9FB5-B77D9CEA37F6&amp;amp;displaylang=en&lt;/span&gt;
&lt;span style="color: #006400"&gt;#&lt;/span&gt;
&lt;span style="color: #006400"&gt;#&lt;/span&gt;            

&lt;span style="color: #a9a9a9"&gt;[&lt;/span&gt;&lt;span style="color: #add8e6"&gt;CmdletBinding&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #000000"&gt;SupportsShouldProcess&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt;&lt;span style="color: #ff4500"&gt;$true&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;]&lt;/span&gt;
&lt;span style="color: #00008b"&gt;param&lt;/span&gt; &lt;span style="color: #000000"&gt;(&lt;/span&gt;
    &lt;span style="color: #a9a9a9"&gt;[&lt;/span&gt;&lt;span style="color: #add8e6"&gt;Parameter&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #000000"&gt;Position&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt;&lt;span style="color: #800080"&gt;1&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;,&lt;/span&gt; &lt;span style="color: #000000"&gt;Mandatory&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt;&lt;span style="color: #ff4500"&gt;$true&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;,&lt;/span&gt; &lt;span style="color: #000000"&gt;ValueFromPipelineByPropertyName&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt;&lt;span style="color: #ff4500"&gt;$true&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;]&lt;/span&gt;
    &lt;span style="color: #a9a9a9"&gt;[&lt;/span&gt;&lt;span style="color: #add8e6"&gt;Alias&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #8b0000"&gt;'FullName'&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;,&lt;/span&gt; &lt;span style="color: #8b0000"&gt;'Path'&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;]&lt;/span&gt;
    &lt;span style="color: #008080"&gt;[string]&lt;/span&gt;&lt;span style="color: #ff4500"&gt;$SourcePath&lt;/span&gt;
    &lt;span style="color: #a9a9a9"&gt;,&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;[&lt;/span&gt;&lt;span style="color: #add8e6"&gt;Parameter&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #000000"&gt;Position&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt;&lt;span style="color: #800080"&gt;2&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;,&lt;/span&gt; &lt;span style="color: #000000"&gt;Mandatory&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt;&lt;span style="color: #ff4500"&gt;$true&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;]&lt;/span&gt;
    &lt;span style="color: #008080"&gt;[string]&lt;/span&gt;&lt;span style="color: #ff4500"&gt;$DestinationPath&lt;/span&gt;
    &lt;span style="color: #a9a9a9"&gt;,&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;[&lt;/span&gt;&lt;span style="color: #add8e6"&gt;Parameter&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #000000"&gt;Position&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt;&lt;span style="color: #800080"&gt;3&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;]&lt;/span&gt;
    &lt;span style="color: #008080"&gt;[string[]]&lt;/span&gt;&lt;span style="color: #ff4500"&gt;$FileNameFilter&lt;/span&gt;
    &lt;span style="color: #a9a9a9"&gt;,&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;[&lt;/span&gt;&lt;span style="color: #add8e6"&gt;Parameter&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #000000"&gt;Position&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt;&lt;span style="color: #800080"&gt;4&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;]&lt;/span&gt;
    &lt;span style="color: #008080"&gt;[string[]]&lt;/span&gt;&lt;span style="color: #ff4500"&gt;$SubdirectoryNameFilter&lt;/span&gt;
&lt;span style="color: #000000"&gt;)&lt;/span&gt;
&lt;span style="color: #006400"&gt;&amp;lt;#
    .Synopsis
        Synchronizes to directory trees
    .Description
        Examines two directory structures (SourcePath and DestinationPath) and uses the Microsoft Sync Framework
        File System Provider to synchronize them.
    .Example
        An example of using the command
#&amp;gt;&lt;/span&gt;
&lt;span style="color: #00008b"&gt;begin&lt;/span&gt;
&lt;span style="color: #000000"&gt;{&lt;/span&gt;
    &lt;span style="color: #008080"&gt;[reflection.assembly]&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;::&lt;/span&gt;&lt;span style="color: #000000"&gt;LoadWithPartialName&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #8b0000"&gt;'Microsoft.Synchronization'&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;|&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Out-Null&lt;/span&gt;
    &lt;span style="color: #008080"&gt;[reflection.assembly]&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;::&lt;/span&gt;&lt;span style="color: #000000"&gt;LoadWithPartialName&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #8b0000"&gt;'Microsoft.Synchronization.Files'&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;|&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Out-Null&lt;/span&gt;            

    &lt;span style="color: #00008b"&gt;function&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;Get-FileSystemChange&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;/span&gt;
    &lt;span style="color: #000000"&gt;{&lt;/span&gt;
        &lt;span style="color: #00008b"&gt;param&lt;/span&gt; &lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #ff4500"&gt;$path&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;,&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$filter&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;,&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$options&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;/span&gt;
        &lt;span style="color: #00008b"&gt;try&lt;/span&gt;
        &lt;span style="color: #000000"&gt;{&lt;/span&gt;
            &lt;span style="color: #ff4500"&gt;$provider&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #0000ff"&gt;new-object&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;Microsoft.Synchronization.Files.FileSyncProvider&lt;/span&gt; &lt;span style="color: #000080"&gt;-ArgumentList&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$path&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;,&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$filter&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;,&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$options&lt;/span&gt;
            &lt;span style="color: #ff4500"&gt;$provider&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;DetectChanges&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;/span&gt;
        &lt;span style="color: #000000"&gt;}&lt;/span&gt;
        &lt;span style="color: #00008b"&gt;finally&lt;/span&gt;
        &lt;span style="color: #000000"&gt;{&lt;/span&gt;
            &lt;span style="color: #00008b"&gt;if&lt;/span&gt; &lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #ff4500"&gt;$provider&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;-ne&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$null&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;/span&gt;
            &lt;span style="color: #000000"&gt;{&lt;/span&gt;
                &lt;span style="color: #ff4500"&gt;$provider&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;Dispose&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;/span&gt;
            &lt;span style="color: #000000"&gt;}&lt;/span&gt;
        &lt;span style="color: #000000"&gt;}&lt;/span&gt;
    &lt;span style="color: #000000"&gt;}&lt;/span&gt;            

    &lt;span style="color: #00008b"&gt;function&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;Invoke-OneWayFileSync&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;/span&gt;
    &lt;span style="color: #000000"&gt;{&lt;/span&gt;
        &lt;span style="color: #00008b"&gt;param&lt;/span&gt; &lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #ff4500"&gt;$SourcePath&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;,&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$DestinationPath&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;,&lt;/span&gt;
                    &lt;span style="color: #ff4500"&gt;$Filter&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;,&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$Options&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;/span&gt;
        &lt;span style="color: #ff4500"&gt;$ApplyChangeJobs&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #000000"&gt;@(&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;/span&gt;
        &lt;span style="color: #ff4500"&gt;$AppliedChangeJobs&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #000000"&gt;@(&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;/span&gt;
        &lt;span style="color: #00008b"&gt;try&lt;/span&gt;
        &lt;span style="color: #000000"&gt;{&lt;/span&gt;
            &lt;span style="color: #006400"&gt;# Scriptblocks to handle the events raised during synchronization&lt;/span&gt;
            &lt;span style="color: #ff4500"&gt;$AppliedChangeAction&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #000000"&gt;{&lt;/span&gt;
                &lt;span style="color: #ff4500"&gt;$argument&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$event&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;SourceEventArgs&lt;/span&gt;
                &lt;span style="color: #00008b"&gt;switch&lt;/span&gt; &lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #ff4500"&gt;$argument&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;ChangeType&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;/span&gt;
                &lt;span style="color: #000000"&gt;{&lt;/span&gt;
                    &lt;span style="color: #000000"&gt;{&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$argument&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;ChangeType&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;-eq&lt;/span&gt; &lt;span style="color: #008080"&gt;[Microsoft.Synchronization.Files.ChangeType]&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;::&lt;/span&gt;&lt;span style="color: #000000"&gt;Create&lt;/span&gt; &lt;span style="color: #000000"&gt;}&lt;/span&gt; &lt;span style="color: #000000"&gt;{&lt;/span&gt;&lt;span style="color: #008080"&gt;[string[]]&lt;/span&gt;&lt;span style="color: #ff4500"&gt;$global:FileSyncReport&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;Created&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;+=&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$argument&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;NewFilePath&lt;/span&gt;&lt;span style="color: #000000"&gt;}&lt;/span&gt;
                    &lt;span style="color: #000000"&gt;{&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$argument&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;ChangeType&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;-eq&lt;/span&gt; &lt;span style="color: #008080"&gt;[Microsoft.Synchronization.Files.ChangeType]&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;::&lt;/span&gt;&lt;span style="color: #000000"&gt;Delete&lt;/span&gt; &lt;span style="color: #000000"&gt;}&lt;/span&gt; &lt;span style="color: #000000"&gt;{&lt;/span&gt;&lt;span style="color: #008080"&gt;[string[]]&lt;/span&gt;&lt;span style="color: #ff4500"&gt;$global:FileSyncReport&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;Deleted&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;+=&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$argument&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;OldFilePath&lt;/span&gt;&lt;span style="color: #000000"&gt;}&lt;/span&gt;
                    &lt;span style="color: #000000"&gt;{&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$argument&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;ChangeType&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;-eq&lt;/span&gt; &lt;span style="color: #008080"&gt;[Microsoft.Synchronization.Files.ChangeType]&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;::&lt;/span&gt;&lt;span style="color: #000000"&gt;Update&lt;/span&gt; &lt;span style="color: #000000"&gt;}&lt;/span&gt; &lt;span style="color: #000000"&gt;{&lt;/span&gt;&lt;span style="color: #008080"&gt;[string[]]&lt;/span&gt;&lt;span style="color: #ff4500"&gt;$global:FileSyncReport&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;Updated&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;+=&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$argument&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;OldFilePath&lt;/span&gt;&lt;span style="color: #000000"&gt;}&lt;/span&gt;
                    &lt;span style="color: #000000"&gt;{&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$argument&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;ChangeType&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;-eq&lt;/span&gt; &lt;span style="color: #008080"&gt;[Microsoft.Synchronization.Files.ChangeType]&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;::&lt;/span&gt;&lt;span style="color: #000000"&gt;Rename&lt;/span&gt; &lt;span style="color: #000000"&gt;}&lt;/span&gt; &lt;span style="color: #000000"&gt;{&lt;/span&gt;&lt;span style="color: #008080"&gt;[string[]]&lt;/span&gt;&lt;span style="color: #ff4500"&gt;$global:FileSyncReport&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;Renamed&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;+=&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$argument&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;OldFilePath&lt;/span&gt;&lt;span style="color: #000000"&gt;}&lt;/span&gt;
                &lt;span style="color: #000000"&gt;}&lt;/span&gt;
            &lt;span style="color: #000000"&gt;}&lt;/span&gt;            

            &lt;span style="color: #ff4500"&gt;$SkippedChangeAction&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #000000"&gt;{&lt;/span&gt;
                &lt;span style="color: #008080"&gt;[string[]]&lt;/span&gt;&lt;span style="color: #ff4500"&gt;$global:FileSyncReport&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;Skipped&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;+=&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$event&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;SourceEventArgs&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;CurrentFilePath&lt;/span&gt;            

                &lt;span style="color: #00008b"&gt;if&lt;/span&gt; &lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #ff4500"&gt;$event&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;SourceEventArgs&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;Exception&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;-ne&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$null&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;/span&gt;
                &lt;span style="color: #000000"&gt;{&lt;/span&gt;
                    &lt;span style="color: #0000ff"&gt;Write-Error&lt;/span&gt; &lt;span style="color: #8b0000"&gt;'['&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;+&lt;/span&gt; &lt;span style="color: #8b0000"&gt;"$($event.SourceEventArgs.Exception.Message)"&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;+']'&lt;/span&gt;
                &lt;span style="color: #000000"&gt;}&lt;/span&gt;
            &lt;span style="color: #000000"&gt;}&lt;/span&gt;            

            &lt;span style="color: #006400"&gt;# Create source provider and register change events for it&lt;/span&gt;            

            &lt;span style="color: #ff4500"&gt;$sourceProvider&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #0000ff"&gt;New-Object&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;Microsoft.Synchronization.Files.FileSyncProvider&lt;/span&gt; &lt;span style="color: #000080"&gt;-ArgumentList&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$SourcePath&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;,&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$filter&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;,&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$options&lt;/span&gt;
            &lt;span style="color: #ff4500"&gt;$AppliedChangeJobs&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;+=&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Register-ObjectEvent&lt;/span&gt; &lt;span style="color: #000080"&gt;-InputObject&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$SourceProvider&lt;/span&gt; &lt;span style="color: #000080"&gt;-EventName&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;AppliedChange&lt;/span&gt; &lt;span style="color: #000080"&gt;-Action&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$AppliedChangeAction&lt;/span&gt;
            &lt;span style="color: #ff4500"&gt;$AppliedChangeJobs&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;+=&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Register-ObjectEvent&lt;/span&gt; &lt;span style="color: #000080"&gt;-InputObject&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$SourceProvider&lt;/span&gt; &lt;span style="color: #000080"&gt;-EventName&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;SkippedChange&lt;/span&gt; &lt;span style="color: #000080"&gt;-Action&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$SkippedChangeAction&lt;/span&gt;             

            &lt;span style="color: #ff4500"&gt;$ApplyChangeJobs&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;+=&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$SourceApplyChangeJob&lt;/span&gt;            

            &lt;span style="color: #006400"&gt;# Create destination provider and register change events for it&lt;/span&gt;
            &lt;span style="color: #ff4500"&gt;$destinationProvider&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #0000ff"&gt;New-Object&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;Microsoft.Synchronization.Files.FileSyncProvider&lt;/span&gt; &lt;span style="color: #000080"&gt;-ArgumentList&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$DestinationPath&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;,&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$filter&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;,&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$options&lt;/span&gt;
            &lt;span style="color: #ff4500"&gt;$AppliedChangeJobs&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;+=&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Register-ObjectEvent&lt;/span&gt; &lt;span style="color: #000080"&gt;-InputObject&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$destinationProvider&lt;/span&gt; &lt;span style="color: #000080"&gt;-EventName&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;AppliedChange&lt;/span&gt; &lt;span style="color: #000080"&gt;-Action&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$AppliedChangeAction&lt;/span&gt;
            &lt;span style="color: #ff4500"&gt;$AppliedChangeJobs&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;+=&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Register-ObjectEvent&lt;/span&gt; &lt;span style="color: #000080"&gt;-InputObject&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$destinationProvider&lt;/span&gt; &lt;span style="color: #000080"&gt;-EventName&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;SkippedChange&lt;/span&gt; &lt;span style="color: #000080"&gt;-Action&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$SkippedChangeAction&lt;/span&gt;            

            &lt;span style="color: #ff4500"&gt;$ApplyChangeJobs&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;+=&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$DestApplyChangeJob&lt;/span&gt;            

            &lt;span style="color: #006400"&gt;# Use scriptblocks for the SyncCallbacks for conflicting items.&lt;/span&gt;
            &lt;span style="color: #ff4500"&gt;$ItemConflictAction&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt;   &lt;span style="color: #000000"&gt;{&lt;/span&gt;
                &lt;span style="color: #ff4500"&gt;$event&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;SourceEventArgs&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;SetResolutionAction&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #008080"&gt;[Microsoft.Synchronization.ConflictResolutionAction]&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;::&lt;/span&gt;&lt;span style="color: #000000"&gt;SourceWins&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;/span&gt;
                &lt;span style="color: #008080"&gt;[string[]]&lt;/span&gt;&lt;span style="color: #ff4500"&gt;$global:FileSyncReport&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;Conflicted&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;+=&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$event&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;SourceEventArgs&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;DestinationChange&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;ItemId&lt;/span&gt;
            &lt;span style="color: #000000"&gt;}&lt;/span&gt;
            &lt;span style="color: #ff4500"&gt;$ItemConstraintAction&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #000000"&gt;{&lt;/span&gt;
                &lt;span style="color: #ff4500"&gt;$event&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;SourceEventArgs&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;SetResolutionAction&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #008080"&gt;[Microsoft.Synchronization.ConstraintConflictResolutionAction]&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;::&lt;/span&gt;&lt;span style="color: #000000"&gt;SourceWins&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;/span&gt;
                &lt;span style="color: #008080"&gt;[string[]]&lt;/span&gt;&lt;span style="color: #ff4500"&gt;$global:FileSyncReport&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;Constrained&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;+=&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$event&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;SourceEventArgs&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;DestinationChange&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;ItemId&lt;/span&gt;
            &lt;span style="color: #000000"&gt;}&lt;/span&gt;            

            &lt;span style="color: #006400"&gt;#Configure the events for conflicts or constraints for the source and destination providers&lt;/span&gt;
            &lt;span style="color: #ff4500"&gt;$destinationCallbacks&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$destinationProvider&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;DestinationCallbacks&lt;/span&gt;
            &lt;span style="color: #ff4500"&gt;$AppliedChangeJobs&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;+=&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Register-ObjectEvent&lt;/span&gt; &lt;span style="color: #000080"&gt;-InputObject&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$destinationCallbacks&lt;/span&gt; &lt;span style="color: #000080"&gt;-EventName&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;ItemConflicting&lt;/span&gt; &lt;span style="color: #000080"&gt;-Action&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$ItemConflictAction&lt;/span&gt;
            &lt;span style="color: #ff4500"&gt;$AppliedChangeJobs&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;+=&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Register-ObjectEvent&lt;/span&gt; &lt;span style="color: #000080"&gt;-InputObject&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$destinationCallbacks&lt;/span&gt; &lt;span style="color: #000080"&gt;-EventName&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;ItemConstraint&lt;/span&gt; &lt;span style="color: #000080"&gt;-Action&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$ItemConstraintAction&lt;/span&gt;             

            &lt;span style="color: #ff4500"&gt;$sourceCallbacks&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$SourceProvider&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;DestinationCallbacks&lt;/span&gt;
            &lt;span style="color: #ff4500"&gt;$AppliedChangeJobs&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;+=&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Register-ObjectEvent&lt;/span&gt; &lt;span style="color: #000080"&gt;-InputObject&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$sourceCallbacks&lt;/span&gt; &lt;span style="color: #000080"&gt;-EventName&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;ItemConflicting&lt;/span&gt; &lt;span style="color: #000080"&gt;-Action&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$ItemConflictAction&lt;/span&gt;
            &lt;span style="color: #ff4500"&gt;$AppliedChangeJobs&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;+=&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Register-ObjectEvent&lt;/span&gt; &lt;span style="color: #000080"&gt;-InputObject&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$sourceCallbacks&lt;/span&gt; &lt;span style="color: #000080"&gt;-EventName&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;ItemConstraint&lt;/span&gt; &lt;span style="color: #000080"&gt;-Action&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$ItemConstraintAction&lt;/span&gt;             

            &lt;span style="color: #006400"&gt;# Create the agent that will perform the file sync&lt;/span&gt;
            &lt;span style="color: #ff4500"&gt;$agent&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #0000ff"&gt;New-Object&lt;/span&gt;  &lt;span style="color: #8a2be2"&gt;Microsoft.Synchronization.SyncOrchestrator&lt;/span&gt;
            &lt;span style="color: #ff4500"&gt;$agent&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;LocalProvider&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$sourceProvider&lt;/span&gt;
            &lt;span style="color: #ff4500"&gt;$agent&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;RemoteProvider&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$destinationProvider&lt;/span&gt;            

            &lt;span style="color: #006400"&gt;# Upload changes from the source to the destination.&lt;/span&gt;
            &lt;span style="color: #ff4500"&gt;$agent&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;Direction&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #008080"&gt;[Microsoft.Synchronization.SyncDirectionOrder]&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;::&lt;/span&gt;&lt;span style="color: #000000"&gt;Upload&lt;/span&gt;            

            &lt;span style="color: #0000ff"&gt;Write-Host&lt;/span&gt; &lt;span style="color: #8b0000"&gt;"Synchronizing changes from $($sourceProvider.RootDirectoryPath) to replica: $($destinationProvider.RootDirectoryPath)"&lt;/span&gt;
            &lt;span style="color: #ff4500"&gt;$agent&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;Synchronize&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;/span&gt;&lt;span style="color: #000000"&gt;;&lt;/span&gt;
        &lt;span style="color: #000000"&gt;}&lt;/span&gt;
        &lt;span style="color: #00008b"&gt;finally&lt;/span&gt;
        &lt;span style="color: #000000"&gt;{&lt;/span&gt;
            &lt;span style="color: #006400"&gt;# Release resources.&lt;/span&gt;
            &lt;span style="color: #00008b"&gt;if&lt;/span&gt; &lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #ff4500"&gt;$sourceProvider&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;-ne&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$null&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;/span&gt; &lt;span style="color: #000000"&gt;{&lt;/span&gt;&lt;span style="color: #ff4500"&gt;$sourceProvider&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;Dispose&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;/span&gt;&lt;span style="color: #000000"&gt;}&lt;/span&gt;
            &lt;span style="color: #00008b"&gt;if&lt;/span&gt; &lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #ff4500"&gt;$destinationProvider&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;-ne&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$null&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;/span&gt; &lt;span style="color: #000000"&gt;{&lt;/span&gt;&lt;span style="color: #ff4500"&gt;$destinationProvider&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;Dispose&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;/span&gt;&lt;span style="color: #000000"&gt;}&lt;/span&gt;
        &lt;span style="color: #000000"&gt;}&lt;/span&gt;
    &lt;span style="color: #000000"&gt;}&lt;/span&gt;            

    &lt;span style="color: #006400"&gt;# Set options for the synchronization session. In this case, options specify&lt;/span&gt;
    &lt;span style="color: #006400"&gt;# that the application will explicitly call FileSyncProvider.DetectChanges, and&lt;/span&gt;
    &lt;span style="color: #006400"&gt;# that items should be moved to the Recycle Bin instead of being permanently deleted.&lt;/span&gt;            

    &lt;span style="color: #ff4500"&gt;$options&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #008080"&gt;[Microsoft.Synchronization.Files.FileSyncOptions]&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;::&lt;/span&gt;&lt;span style="color: #000000"&gt;ExplicitDetectChanges&lt;/span&gt;
    &lt;span style="color: #ff4500"&gt;$options&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$options&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;-bor&lt;/span&gt; &lt;span style="color: #008080"&gt;[Microsoft.Synchronization.Files.FileSyncOptions]&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;::&lt;/span&gt;&lt;span style="color: #000000"&gt;RecycleDeletedFiles&lt;/span&gt;
    &lt;span style="color: #ff4500"&gt;$options&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$options&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;-bor&lt;/span&gt; &lt;span style="color: #008080"&gt;[Microsoft.Synchronization.Files.FileSyncOptions]&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;::&lt;/span&gt;&lt;span style="color: #000000"&gt;RecyclePreviousFileOnUpdates&lt;/span&gt;
    &lt;span style="color: #ff4500"&gt;$options&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$options&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;-bor&lt;/span&gt; &lt;span style="color: #008080"&gt;[Microsoft.Synchronization.Files.FileSyncOptions]&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;::&lt;/span&gt;&lt;span style="color: #000000"&gt;RecycleConflictLoserFiles&lt;/span&gt;
&lt;span style="color: #000000"&gt;}&lt;/span&gt;
&lt;span style="color: #00008b"&gt;process&lt;/span&gt;
&lt;span style="color: #000000"&gt;{&lt;/span&gt;
    &lt;span style="color: #ff4500"&gt;$filter&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #0000ff"&gt;New-Object&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;Microsoft.Synchronization.Files.FileSyncScopeFilter&lt;/span&gt;
    &lt;span style="color: #00008b"&gt;if&lt;/span&gt; &lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #ff4500"&gt;$FileNameFilter&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;count&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;-gt&lt;/span&gt; &lt;span style="color: #800080"&gt;0&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;/span&gt;
    &lt;span style="color: #000000"&gt;{&lt;/span&gt;
       &lt;span style="color: #ff4500"&gt;$FileNameFilter&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;|&lt;/span&gt; &lt;span style="color: #0000ff"&gt;ForEach-Object&lt;/span&gt; &lt;span style="color: #000000"&gt;{&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$filter&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;FileNameExcludes&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;Add&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #ff4500"&gt;$_&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;/span&gt; &lt;span style="color: #000000"&gt;}&lt;/span&gt;
    &lt;span style="color: #000000"&gt;}&lt;/span&gt;
    &lt;span style="color: #00008b"&gt;if&lt;/span&gt; &lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #ff4500"&gt;$SubdirectoryNameFilter&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;count&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;-gt&lt;/span&gt; &lt;span style="color: #800080"&gt;0&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;/span&gt;
    &lt;span style="color: #000000"&gt;{&lt;/span&gt;
       &lt;span style="color: #ff4500"&gt;$SubdirectoryNameFilter&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;|&lt;/span&gt; &lt;span style="color: #0000ff"&gt;ForEach-Object&lt;/span&gt; &lt;span style="color: #000000"&gt;{&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$filter&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;SubdirectoryExcludes&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;Add&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #ff4500"&gt;$_&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;/span&gt; &lt;span style="color: #000000"&gt;}&lt;/span&gt;
    &lt;span style="color: #000000"&gt;}&lt;/span&gt;            

    &lt;span style="color: #006400"&gt;# Perform the detect changes operation on the two file locations&lt;/span&gt;
    &lt;span style="color: #0000ff"&gt;Get-FileSystemChange&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$SourcePath&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$filter&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$options&lt;/span&gt;
    &lt;span style="color: #0000ff"&gt;Get-FileSystemChange&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$DestinationPath&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$filter&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$options&lt;/span&gt;            

    &lt;span style="color: #006400"&gt;# Reporting Object - using the global scope so that it can be updated by the event scriptblocks.&lt;/span&gt;
    &lt;span style="color: #ff4500"&gt;$global:FileSyncReport&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #0000ff"&gt;New-Object&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;PSObject&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;|&lt;/span&gt;
        &lt;span style="color: #0000ff"&gt;Select-Object&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;SourceStats&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;,&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;DestinationStats&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;,&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;Created&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;,&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;Deleted&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;,&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;Overwritten&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;,&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;Renamed&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;,&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;Skipped&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;,&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;Conflicted&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;,&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;Constrained&lt;/span&gt;            

    &lt;span style="color: #006400"&gt;# We don't need to pass any filters here, since we are using the file detection that was previously completed.&lt;/span&gt;
    &lt;span style="color: #006400"&gt;# this will only &lt;/span&gt;
    &lt;span style="color: #ff4500"&gt;$global:FileSyncReport&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;SourceStats&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Invoke-OneWayFileSync&lt;/span&gt; &lt;span style="color: #000080"&gt;-SourcePath&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$SourcePath&lt;/span&gt; &lt;span style="color: #000080"&gt;-DestinationPath&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$DestinationPath&lt;/span&gt; &lt;span style="color: #000080"&gt;-Filter&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$null&lt;/span&gt; &lt;span style="color: #000080"&gt;-Options&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$options&lt;/span&gt;
    &lt;span style="color: #ff4500"&gt;$global:FileSyncReport&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;DestinationStats&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Invoke-OneWayFileSync&lt;/span&gt; &lt;span style="color: #000080"&gt;-SourcePath&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$DestinationPath&lt;/span&gt; &lt;span style="color: #000080"&gt;-DestinationPath&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$SourcePath&lt;/span&gt; &lt;span style="color: #000080"&gt;-Filter&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$null&lt;/span&gt; &lt;span style="color: #000080"&gt;-Options&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$options&lt;/span&gt;            

    &lt;span style="color: #006400"&gt;# Write result to pipeline&lt;/span&gt;
    &lt;span style="color: #0000ff"&gt;Write-Output&lt;/span&gt; &lt;span style="color: #ff4500"&gt;$global:FileSyncReport&lt;/span&gt;
&lt;span style="color: #000000"&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;h3 class="PowerShellColorizedScript"&gt;&lt;span style="color: #000000"&gt;&lt;a href="http://download.usepowershell.com/Invoke-SyncFrameworkSample.zip" target="_blank"&gt;Download Invoke-SyncFrameworkSample.zip&lt;/a&gt;&lt;/span&gt;&lt;/h3&gt;

&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/C2zpS-18bMWK5esbwGRdauOGuow/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/C2zpS-18bMWK5esbwGRdauOGuow/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/C2zpS-18bMWK5esbwGRdauOGuow/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/C2zpS-18bMWK5esbwGRdauOGuow/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/UsePowershell?a=VCA7sHWAaGw:IHFaeMicKsM:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/UsePowershell?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/UsePowershell/~4/VCA7sHWAaGw" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://blog.usepowershell.com/2009/11/using-the-sync-framework-from-powershell/#comments" thr:count="8" />
		<link rel="replies" type="application/atom+xml" href="http://blog.usepowershell.com/2009/11/using-the-sync-framework-from-powershell/feed/atom/" thr:count="8" />
		<thr:total>8</thr:total>
	<feedburner:origLink>http://blog.usepowershell.com/2009/11/using-the-sync-framework-from-powershell/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Steven Murawski</name>
						<uri>http://www.usepowershell.com</uri>
					</author>
		<title type="html"><![CDATA[So Easy, I Could Kick Myself]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/UsePowershell/~3/gF4cZMg1b28/" />
		<id>http://blog.usepowershell.com/2009/11/so-easy-i-could-kick-myself/</id>
		<updated>2010-01-07T22:18:29Z</updated>
		<published>2009-11-12T21:24:00Z</published>
		<category scheme="http://blog.usepowershell.com" term="Crystal Reports" /><category scheme="http://blog.usepowershell.com" term="PowerShell" /><category scheme="http://blog.usepowershell.com" term="PowerShell Version 2" /><category scheme="http://blog.usepowershell.com" term="Scripts" />		<summary type="html"><![CDATA[I’m updating Crystal Reports and trying to determine which reports might have been affected by some schema changes or functional changes in how the data was being stored. 
The problem I’ve had is that when there are a large number of reports, it is very time consuming to open each one, look at it, and see [...]]]></summary>
		<content type="html" xml:base="http://blog.usepowershell.com/2009/11/so-easy-i-could-kick-myself/">&lt;p&gt;I’m updating Crystal Reports and trying to determine which reports might have been affected by some schema changes or functional changes in how the data was being stored. &lt;/p&gt;
&lt;p&gt;The problem I’ve had is that when there are a large number of reports, it is very time consuming to open each one, look at it, and see if it contains any affected tables or views.&lt;/p&gt;
&lt;p&gt;I’ve had to deal with this in my previous role as well.  After feeling the pain a few times, I turned my intern loose on the problem and shelved the problem as “just another pain in dealing with Crystal Reports”.&lt;/p&gt;
&lt;p&gt;Now, I’m back dealing with Crystal Reports more frequently and in the position to have to possibly update around 30 or 40 reports that were written before I started.&lt;/p&gt;
&lt;p&gt;I’ve recently had a bit of exposure to the object model for the &lt;a href="http://msdn.microsoft.com/en-us/library/bb944221.aspx" target="_blank"&gt;.NET API for Crystal Reports&lt;/a&gt; and thought maybe I could leverage that through &lt;a href="http://msdn.microsoft.com/en-us/library/ms714418(VS.85).aspx" target="_blank"&gt;PowerShell&lt;/a&gt; and whip together a quick script to help me list out the tables in each report.&lt;/p&gt;
&lt;p&gt;It turned out to be painfully easy… &lt;/p&gt;
&lt;pre class="PowerShellColorizedScript"&gt;&lt;span style="color: #008080"&gt;[reflection.assembly]&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;::&lt;/span&gt;&lt;span style="color: #000000"&gt;LoadWithPartialName&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #8b0000"&gt;'CrystalDecisions.Shared'&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;/span&gt;
&lt;span style="color: #008080"&gt;[reflection.assembly]&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;::&lt;/span&gt;&lt;span style="color: #000000"&gt;LoadWithPartialName&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #8b0000"&gt;'CrystalDecisions.CrystalReports.Engine'&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;/span&gt;
&lt;span style="color: #ff4500"&gt;$report&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;=&lt;/span&gt; &lt;span style="color: #0000ff"&gt;New-Object&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;CrystalDecisions.CrystalReports.Engine.ReportDocument&lt;/span&gt;
&lt;span style="color: #ff4500"&gt;$report&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;load&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #ff4500"&gt;$pathToScript&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;/span&gt;
&lt;span style="color: #ff4500"&gt;$report&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;Database&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;Tables&lt;/span&gt; &lt;span style="color: #a9a9a9"&gt;|&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Select-Object&lt;/span&gt; &lt;span style="color: #000080"&gt;-expand&lt;/span&gt; &lt;span style="color: #8a2be2"&gt;Name&lt;/span&gt;
&lt;span style="color: #ff4500"&gt;$report&lt;/span&gt;&lt;span style="color: #a9a9a9"&gt;.&lt;/span&gt;&lt;span style="color: #000000"&gt;Dispose&lt;/span&gt;&lt;span style="color: #000000"&gt;(&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;After I got the basics, I poked around and updated the script further (&lt;a href="http://poshcode.org/1471" target="_blank"&gt;and posted it on PoshCode&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;The full script also accesses the first level of subreports and retrieves their tables as well.&lt;/p&gt;
&lt;p&gt;NOTE: &lt;a href="http://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=56787567" target="_blank"&gt;Requires either the Crystal Report Runtime (Visual Studio 2008) &lt;/a&gt; or Visual Studio to be installed.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;a href="http://download.usepowershell.com/get-crystalreporttable.ps1"&gt;DOWNLOAD UPDATED SCRIPT &lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/WE45PI0vBJhtvMuiqSCvv0WgiRQ/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/WE45PI0vBJhtvMuiqSCvv0WgiRQ/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/WE45PI0vBJhtvMuiqSCvv0WgiRQ/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/WE45PI0vBJhtvMuiqSCvv0WgiRQ/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/UsePowershell?a=gF4cZMg1b28:d16QCTa18AI:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/UsePowershell?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/UsePowershell/~4/gF4cZMg1b28" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://blog.usepowershell.com/2009/11/so-easy-i-could-kick-myself/#comments" thr:count="2" />
		<link rel="replies" type="application/atom+xml" href="http://blog.usepowershell.com/2009/11/so-easy-i-could-kick-myself/feed/atom/" thr:count="2" />
		<thr:total>2</thr:total>
	<feedburner:origLink>http://blog.usepowershell.com/2009/11/so-easy-i-could-kick-myself/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Steven Murawski</name>
						<uri>http://www.usepowershell.com</uri>
					</author>
		<title type="html"><![CDATA[All Sorts of New]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/UsePowershell/~3/vMnnBi8yBtc/" />
		<id>http://blog.usepowershell.com/2009/11/all-sorts-of-new/</id>
		<updated>2009-11-12T13:00:00Z</updated>
		<published>2009-11-12T13:00:00Z</published>
		<category scheme="http://blog.usepowershell.com" term="General" />		<summary type="html"><![CDATA[A lot has happened since I last had the opportunity to post.&#160; 
Quick recap:

PowerShell v2 is now out and available for XP, Server 2003, Vista, Server 2008, and installed and on by default for Windows 7 and Server 2008 R2 
SharePoint 2010 has an insane number (492) 
There is an open source cmdlet and help [...]]]></summary>
		<content type="html" xml:base="http://blog.usepowershell.com/2009/11/all-sorts-of-new/">&lt;p&gt;A lot has happened since I last had the opportunity to post.&amp;#160; &lt;/p&gt;
&lt;p&gt;Quick recap:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://blogs.msdn.com/powershell/archive/2009/10/22/tonight-is-the-virtual-launch-party-powerscripting-podcast.aspx" target="_blank"&gt;PowerShell v2 is now out&lt;/a&gt; and available for &lt;a href="http://blogs.msdn.com/powershell/archive/2009/10/27/windows-management-framework-is-here.aspx" target="_blank"&gt;XP, Server 2003, Vista, Server 2008,&lt;/a&gt; and installed and on by default for Windows 7 and Server 2008 R2 &lt;/li&gt;
&lt;li&gt;SharePoint 2010 has an insane number (&lt;a href="http://dmitrysotnikov.wordpress.com/2009/10/19/sharepoint-2010-cmdlet-reference/" target="_blank"&gt;492&lt;/a&gt;) &lt;/li&gt;
&lt;li&gt;There is an &lt;a href="http://www.codeplex.com/CmdletDesigner" target="_blank"&gt;open source cmdlet and help designer&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="http://trypowershell.codeplex.com/" target="_blank"&gt;Try PowerShell&lt;/a&gt; is a great way to explore &lt;/li&gt;
&lt;li&gt;The &lt;a href="http://code.msdn.microsoft.com/PowerShellPack" target="_blank"&gt;PowershellPack&lt;/a&gt; provides some great modules that get you jump started with V2. &lt;/li&gt;
&lt;li&gt;&lt;a href="http://code.msdn.microsoft.com/azurecmdlets" target="_blank"&gt;Azure has cmdlets for management&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;There is introductory PowerShell material in the &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=c48b3eb4-ad4b-461c-9d5a-25f45d949b92&amp;amp;displaylang=en" target="_blank"&gt;Server 2008 R2 Developer Training Kit&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="http://channel9.msdn.com/learn/courses/WindowsServer2008R2/PowerShell/" target="_blank"&gt;There are some PowerShell for Developers training videos on Channel 9&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.jameskovacs.com/blog/ReleasingPsakeV100PsakeV200.aspx" target="_blank"&gt;James Kovacs released psake V2.00&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="http://pstfs.codeplex.com/" target="_blank"&gt;PsTFS has hit V1&lt;/a&gt; – which is great for me now.. &lt;/li&gt;
&lt;li&gt;I’m sure I’ve missed a ton of other cool &lt;a href="http://msdn.microsoft.com/en-us/library/ms714418(VS.85).aspx" target="_blank"&gt;PowerShell&lt;/a&gt; stuff that is happening too.. &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;And that leads me to what I’m doing now.&amp;#160; &lt;/p&gt;
&lt;p&gt;In August, I left my job as a IT Specialist for a municipal police department and took a job heading up research and development for &lt;a href="http://www.prophoenix.com" target="_blank"&gt;ProPhoenix&lt;/a&gt;, which is a software development company that make software for public safety agencies (police, fire, corrections, municipal courts).&lt;/p&gt;
&lt;p&gt;I now live in a more software development focused world and will get to spend more time focusing on using PowerShell to automate my current activities, explore new frameworks, and to build a management API for our applications.&amp;#160; I can’t wait to make PowerShell a requirement for our server products installation so I can get our support staff to start leveraging the capabilities PowerShell brings to the table.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/q73NYoQWFhBLwerVLlgVMSUYRGU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/q73NYoQWFhBLwerVLlgVMSUYRGU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/q73NYoQWFhBLwerVLlgVMSUYRGU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/q73NYoQWFhBLwerVLlgVMSUYRGU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/UsePowershell?a=vMnnBi8yBtc:k5mnJAJG_wg:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/UsePowershell?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/UsePowershell/~4/vMnnBi8yBtc" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://blog.usepowershell.com/2009/11/all-sorts-of-new/#comments" thr:count="2" />
		<link rel="replies" type="application/atom+xml" href="http://blog.usepowershell.com/2009/11/all-sorts-of-new/feed/atom/" thr:count="2" />
		<thr:total>2</thr:total>
	<feedburner:origLink>http://blog.usepowershell.com/2009/11/all-sorts-of-new/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Steven Murawski</name>
						<uri>http://www.usepowershell.com</uri>
					</author>
		<title type="html"><![CDATA[PowerShell in Azure]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/UsePowershell/~3/vqYjl7RbOy0/" />
		<id>http://blog.usepowershell.com/2009/07/powershell-in-azure/</id>
		<updated>2009-07-21T16:53:34Z</updated>
		<published>2009-07-21T16:53:34Z</published>
		<category scheme="http://blog.usepowershell.com" term="Azure" /><category scheme="http://blog.usepowershell.com" term="Development" /><category scheme="http://blog.usepowershell.com" term="PowerShell" />		<summary type="html"><![CDATA[The July CTP release of the Windows Azure SDK contains a new sample project called PowerShellRole which demonstrates that PowerShell is available in the cloud!
Previous versions of the CTP have come with a sample Provider which you could use to access Azure storage (blobs, queues, and tables), but this actually provides demonstration of creating runspaces [...]]]></summary>
		<content type="html" xml:base="http://blog.usepowershell.com/2009/07/powershell-in-azure/">&lt;p&gt;The &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=aa40f3e2-afc5-484d-b4e9-6a5227e73590&amp;amp;displaylang=en" target="_blank"&gt;July CTP release of the Windows Azure SDK&lt;/a&gt; contains a new sample project called PowerShellRole which demonstrates that PowerShell is available in the cloud!&lt;/p&gt;
&lt;p&gt;Previous versions of the CTP have come with a sample Provider which you could use to access Azure storage (blobs, queues, and tables), but this actually provides demonstration of creating runspaces and executing pipelines in the cloud.&lt;/p&gt;
&lt;p&gt;Now to see what version is running in the cloud!&lt;/p&gt;

&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/tVycZ-X9ExVKxHBD64nLA_-E8L0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/tVycZ-X9ExVKxHBD64nLA_-E8L0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/tVycZ-X9ExVKxHBD64nLA_-E8L0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/tVycZ-X9ExVKxHBD64nLA_-E8L0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/UsePowershell?a=vqYjl7RbOy0:rHwCUZf0txk:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/UsePowershell?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/UsePowershell/~4/vqYjl7RbOy0" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://blog.usepowershell.com/2009/07/powershell-in-azure/#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://blog.usepowershell.com/2009/07/powershell-in-azure/feed/atom/" thr:count="0" />
		<thr:total>0</thr:total>
	<feedburner:origLink>http://blog.usepowershell.com/2009/07/powershell-in-azure/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Steven Murawski</name>
						<uri>http://www.usepowershell.com</uri>
					</author>
		<title type="html"><![CDATA[Deep Dive: Error Handling &#8211; Error Types (part 1)]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/UsePowershell/~3/vtnKbHP2fiI/" />
		<id>http://blog.usepowershell.com/2009/07/deep-dive-error-handling-error-types-part-1/</id>
		<updated>2009-11-20T19:12:55Z</updated>
		<published>2009-07-21T12:00:00Z</published>
		<category scheme="http://blog.usepowershell.com" term=".NET Framework" /><category scheme="http://blog.usepowershell.com" term="Base Class Libraries" /><category scheme="http://blog.usepowershell.com" term="Deep Dive" /><category scheme="http://blog.usepowershell.com" term="Error Handling" /><category scheme="http://blog.usepowershell.com" term="PowerShell Version 1" /><category scheme="http://blog.usepowershell.com" term="PowerShell Version 2" />		<summary type="html"><![CDATA[I started looking a little deeper at error handling in PowerShell after this StackOverflow question.
PowerShell has two kinds of errors – terminating errors and non-terminating errors.
Terminating errors are the errors that can stop command execution cold.  Non-terminating errors provided an additional challenge, as you need to be notified of failed operations and continue with pipeline [...]]]></summary>
		<content type="html" xml:base="http://blog.usepowershell.com/2009/07/deep-dive-error-handling-error-types-part-1/">&lt;p&gt;I started looking a little deeper at error handling in PowerShell after &lt;a href="http://stackoverflow.com/questions/1142211/try-catch-does-not-seem-to-have-an-effect" target="_blank"&gt;this StackOverflow question&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;PowerShell has two kinds of errors – terminating errors and non-terminating errors.&lt;/p&gt;
&lt;p&gt;Terminating errors are the errors that can stop command execution cold.  Non-terminating errors provided an additional challenge, as you need to be notified of failed operations and continue with pipeline operations.  To deal with this issue and to provide additional output options, PowerShell employs the concept of streams.  There are three additional streams (other than the primary pipeline stream) available in PowerShell – Verbose, Warning, and Error (and .  We’ll be concerning ourselves with the output from the Error stream.&lt;/p&gt;
&lt;p&gt;There are some &lt;a href="http://technet.microsoft.com/en-us/library/dd347675.aspx" target="_blank"&gt;automatic variables&lt;/a&gt; in the shell that deal with errors as well.  $ErrorActionPreference is a variable that describes how PowerShell will treat non-terminating errors.  $ErrorActionPreference has four options: “Continue” (the default), “SilentlyContinue”, “Inquire”, and “Stop”.  $error is an array of all the errors that have occurred in the current session up to the number specified in $MaximumErrorCount.  $? is a boolean value that is $true if the previous operation succeeded and $false if it did not.&lt;/p&gt;
&lt;p&gt;PowerShell does have some built in flexibility to turn non-terminating errors into terminating errors.  Based on our setting of $ErrorActionPreference, PowerShell will treat a non-terminating error differently.  If $ErrorActionPreference is set to &amp;#8216;”Stop”, PowerShell will treat the errors from that scope and all sub scopes (unless explicitly overridden) as terminating errors.  If “Inquire” is chosen as the $ErrorActionPreference, then PowerShell will prompt the user at the console upon each error to ask whether it should continue (treat as non-terminating) or halt (treat as terminating), as well as providing an option to drop into a nested prompt.&lt;/p&gt;
&lt;p&gt;$ErrorActionPreference is a global preference that can be set, but the PowerShell runtime also allows more granular control by providing &lt;a href="http://technet.microsoft.com/en-us/library/dd315352.aspx" target="_blank"&gt;common parameters&lt;/a&gt; for -ErrorAction and -ErrorVariable (shorthand -EA and –EV) which allow you to determine per cmdlet (and in V2 per advanced function) how errors should be handled.  The –ErrorAction parameter takes the same options as $ErrorActionPreference.&lt;/p&gt;
&lt;p&gt;So what happens when you encounter an error?&lt;/p&gt;
&lt;p&gt;If you hit a terminating error, your script, function, or command will stop.  The error will be logged to the $error variable and written to the error stream.  The $? will be set to false.  You can use the &lt;a href="http://technet.microsoft.com/en-us/library/dd347548.aspx" target="_blank"&gt;trap construct&lt;/a&gt; (or the &lt;a href="http://technet.microsoft.com/en-us/library/dd315350.aspx" target="_blank"&gt;try/catch/finally construct&lt;/a&gt; in V2) to deal with terminating errors and we’ll cover that further in the fourth post in this series.&lt;/p&gt;
&lt;p&gt;If you hit a non-terminating error, the result will depend on the $ErrorActionPreference in the scope or the –ErrorAction parameter.  If the $ErrorActionPreference or –ErrorAction parameter is set to ‘Continue’, the error will be written to the error stream, added to the $error array, and the $? will be set to $false.  ‘SilentlyContinue’ will not write an error to the Error stream, but $error and $? are updated.  Finally, ‘Inquire’ provides you an option at each error as to whether to treat it as terminating or non-terminating.  If treated as a non-terminating error, the error will be treated like the $ErrorActionPreference or –ErrorAction parameter is ‘Continue’.&lt;/p&gt;
&lt;p&gt;Now, I’ve mentioned that some terminating and non-terminating errors both write to the Error stream, so where does that actually get reported back to the user?  If an error has been written to the error stream, it will be written to the output stream (which may surface differently based on the PowerShell host) separately from the pipeline output unless it is redirected.  This means that the exception objects, which are how the errors are represented, are not saved to a variable if you are assigning the pipeline output to a variable.&lt;/p&gt;
&lt;p&gt;For example:&lt;/p&gt;
&lt;p&gt;$results = Get-WMIObject Win32_Bios –ComputerName localhost, ComputerThatDoesNotExist&lt;br /&gt;
Get-WmiObject : The RPC server is unavailable. (Exception from HRESULT: 0&amp;#215;800706BA)&lt;br /&gt;
At line:1 char:22&lt;br /&gt;
+ $results = Get-WmiObject  &amp;lt;&amp;lt;&amp;lt;&amp;lt; Win32_Bios -ComputerName localhost, ComputerThatDoesNotExist&lt;/p&gt;
&lt;p&gt;creates this output to the screen, but $results will only hold the results of the successful WMI query.  This is where the –ErrorVariable comes in.  You can specify a variable to hold the exceptions generated by a particular cmdlet (or in V2 advanced function).  Specifying a variable does not remove an item from being written to the error stream and displayed as output.&lt;/p&gt;
&lt;p&gt;In a console session, you can redirect the error stream with the redirection operators ( 2&amp;gt; or 2&amp;gt;&amp;gt;) or you can merge the error stream with the output stream (2&amp;gt;&amp;amp;1) and write the output to a file, the pipeline, or assign it to a variable.&lt;/p&gt;
&lt;p&gt;Up next:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Error Objects&lt;/li&gt;
&lt;li&gt;Tracing Errors&lt;/li&gt;
&lt;li&gt;Trapping Errors&lt;/li&gt;
&lt;li&gt;Reporting Errors&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Other great &lt;a href="http://support.microsoft.com/kb/968929" target="_blank"&gt;PowerShell&lt;/a&gt; Error Handling posts:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://huddledmasses.org/trap-exception-in-powershell/"&gt;http://huddledmasses.org/trap-exception-in-powershell/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://blogs.msdn.com/powershell/archive/2006/11/03/erroraction-and-errorvariable.aspx"&gt;http://blogs.msdn.com/powershell/archive/2006/11/03/erroraction-and-errorvariable.aspx&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://tfl09.blogspot.com/2009/01/error-handling-with-powershell.html"&gt;http://tfl09.blogspot.com/2009/01/error-handling-with-powershell.html&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://weblogs.asp.net/adweigert/archive/2007/10/10/powershell-try-catch-finally-comes-to-life.aspx"&gt;http://weblogs.asp.net/adweigert/archive/2007/10/10/powershell-try-catch-finally-comes-to-life.aspx&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://powershell.com/cs/blogs/ebook/archive/2009/03/30/chapter-11-finding-and-avoiding-errors.aspx"&gt;http://powershell.com/cs/blogs/ebook/archive/2009/03/30/chapter-11-finding-and-avoiding-errors.aspx&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/FFrnoeLTaz4oKDHkxHvH9rVt8jU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/FFrnoeLTaz4oKDHkxHvH9rVt8jU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/FFrnoeLTaz4oKDHkxHvH9rVt8jU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/FFrnoeLTaz4oKDHkxHvH9rVt8jU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/UsePowershell?a=vtnKbHP2fiI:wUzm0XBVJfY:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/UsePowershell?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/UsePowershell/~4/vtnKbHP2fiI" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://blog.usepowershell.com/2009/07/deep-dive-error-handling-error-types-part-1/#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://blog.usepowershell.com/2009/07/deep-dive-error-handling-error-types-part-1/feed/atom/" thr:count="0" />
		<thr:total>0</thr:total>
	<feedburner:origLink>http://blog.usepowershell.com/2009/07/deep-dive-error-handling-error-types-part-1/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Steven Murawski</name>
						<uri>http://www.usepowershell.com</uri>
					</author>
		<title type="html"><![CDATA[Exploring the .NET Framework with PowerShell &#8211; Garbage Collection (Part 6)]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/UsePowershell/~3/Ux7PCSP1mwo/" />
		<id>http://blog.usepowershell.com/2009/07/exploring-the-net-framework-with-powershell-garbage-collection-part-6/</id>
		<updated>2009-07-07T12:00:00Z</updated>
		<published>2009-07-07T12:00:00Z</published>
		<category scheme="http://blog.usepowershell.com" term=".NET Framework" /><category scheme="http://blog.usepowershell.com" term="PowerShell" />		<summary type="html"><![CDATA[Garbage collection is a process that the .NET Framework (upon which the PowerShell runtime works) uses to manage memory.&#160; The garbage collection (for applications – services are handled a bit differently) process basically covers X steps:

Identify objects that won’t be used 
Delete them from memory 
Compact the space to make room for new objects 

The [...]]]></summary>
		<content type="html" xml:base="http://blog.usepowershell.com/2009/07/exploring-the-net-framework-with-powershell-garbage-collection-part-6/">&lt;p&gt;Garbage collection is a process that the .NET Framework (upon which the PowerShell runtime works) uses to manage memory.&amp;#160; The garbage collection (for applications – services are handled a bit differently) process basically covers X steps:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Identify objects that won’t be used &lt;/li&gt;
&lt;li&gt;Delete them from memory &lt;/li&gt;
&lt;li&gt;Compact the space to make room for new objects &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The first step is the critical point for PowerShell users.&amp;#160; You may have noticed how the memory used in a PowerShell session can steadily climb (or suddenly climb if you’re dealing with a large number of objects).&amp;#160; I talked about that in &lt;a href="http://blog.usepowershell.com/2009/03/tip-free-up-some-memory/" target="_blank"&gt;this tip&lt;/a&gt;.&amp;#160; The .NET garbage collector looks for objects that are still in use or could possibly be in use in the near future (this is a gross oversimplification &amp;#8211; if you are really interested in a detailed explanation of how garbage collection works in the .NET Framework, &lt;a href="http://www.simple-talk.com/content/article.aspx?article=737" target="_blank"&gt;check out this article&lt;/a&gt;.) &lt;/p&gt;
&lt;p&gt;What this means to scripters who are running into memory pressure issues is that the garbage collector will not reclaim any objects you have actively referenced (meaning that you’ve assigned them to a variable) in your current or higher scope.&amp;#160; &lt;/p&gt;
&lt;p&gt;Since this can sound a bit convoluted let’s look at an example.&amp;#160; &lt;/p&gt;
&lt;p&gt;I read a large file to parse it and leave the contents of the original stored in a variable&lt;/p&gt;
&lt;p&gt;PS&amp;gt; $MyLargeFile =&amp;#160; &lt;a href="http://go.microsoft.com/fwlink/?LinkID=113310"&gt;Get-Content&lt;/a&gt; MyLargeFile.txt    &lt;br /&gt;PS&amp;gt; Foreach ($line in $MyLargeFile) {    &lt;br /&gt;DoSomething $line | &lt;a href="http://go.microsoft.com/fwlink/?LinkID=113363"&gt;Out-File&lt;/a&gt; NewUpdatedLargeFile.txt    &lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;One of the problems with the above pattern is that the original file remains saved in memory and doesn’t get released unless you explicitly remove the reference, either by using &lt;a href="http://go.microsoft.com/fwlink/?LinkID=113380"&gt;Remove-Variable&lt;/a&gt; or &lt;a href="http://go.microsoft.com/fwlink/?LinkID=113373"&gt;Remove-Item&lt;/a&gt; or by changing what $MyLargeFile points to by assigning another value to it.&amp;#160; &lt;/p&gt;
&lt;p&gt;This isn’t VBScript where you have to set values to “Nothing”, but you should be aware of what larger object sets you are retaining in memory.&amp;#160; &lt;/p&gt;

&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/tBa4LJTl7G-hcCd-eEXvueAgoiI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/tBa4LJTl7G-hcCd-eEXvueAgoiI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/tBa4LJTl7G-hcCd-eEXvueAgoiI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/tBa4LJTl7G-hcCd-eEXvueAgoiI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/UsePowershell?a=Ux7PCSP1mwo:VAv2_u_88O0:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/UsePowershell?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/UsePowershell/~4/Ux7PCSP1mwo" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://blog.usepowershell.com/2009/07/exploring-the-net-framework-with-powershell-garbage-collection-part-6/#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://blog.usepowershell.com/2009/07/exploring-the-net-framework-with-powershell-garbage-collection-part-6/feed/atom/" thr:count="0" />
		<thr:total>0</thr:total>
	<feedburner:origLink>http://blog.usepowershell.com/2009/07/exploring-the-net-framework-with-powershell-garbage-collection-part-6/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Steven Murawski</name>
						<uri>http://www.usepowershell.com</uri>
					</author>
		<title type="html"><![CDATA[Dear Devs,  Give Us The Tools.  K Thx]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/UsePowershell/~3/oR03OIrDwbw/" />
		<id>http://blog.usepowershell.com/2009/07/dear-devs-give-us-the-tools-k-thx/</id>
		<updated>2009-07-06T21:34:30Z</updated>
		<published>2009-07-06T21:31:09Z</published>
		<category scheme="http://blog.usepowershell.com" term="Development" /><category scheme="http://blog.usepowershell.com" term="General" /><category scheme="http://blog.usepowershell.com" term="PowerShell" /><category scheme="http://blog.usepowershell.com" term="Systems Administration" />		<summary type="html"><![CDATA[I just finished listening to the latest Herding Code podcast (#52) where the hosts (K. Scott Allen, Kevin Dente, Scott Koon, and Jon Galloway) talked with Alan Stevens ( C# MVP and ASP Insider) and G. Andrew Duthie (author and Microsoft Developer Evangelist) about a debate that began on Twitter regarding “Real Software Development vs [...]]]></summary>
		<content type="html" xml:base="http://blog.usepowershell.com/2009/07/dear-devs-give-us-the-tools-k-thx/">&lt;p&gt;I just finished listening to the latest &lt;a href="http://herdingcode.com" target="_blank"&gt;Herding Code&lt;/a&gt; podcast &lt;a href="http://herdingcode.com/?p=191" target="_blank"&gt;(#52)&lt;/a&gt; where the hosts (&lt;a href="http://odetocode.com/" target="_blank"&gt;K. Scott Allen&lt;/a&gt;, &lt;a href="http://weblogs.asp.net/kdente" target="_blank"&gt;Kevin Dente&lt;/a&gt;, &lt;a href="http://lazycoder.com/" target="_blank"&gt;Scott Koon&lt;/a&gt;, and &lt;a href="http://weblogs.asp.net/jgalloway" target="_blank"&gt;Jon Galloway&lt;/a&gt;) talked with &lt;a href="http://netcave.org/" target="_blank"&gt;Alan Stevens&lt;/a&gt; ( C# MVP and ASP Insider) and &lt;a href="http://blogs.msdn.com/gduthie/" target="_blank"&gt;G. Andrew Duthie&lt;/a&gt; (author and Microsoft Developer Evangelist) about a debate that began on Twitter regarding “Real Software Development vs Microsoft Bubble Development”.&lt;/p&gt;
&lt;p&gt;What does that have to do with PowerShell and administrative tools?  The specifics of their conversation don’t have a lot of relevance to administrators and scripters, but one of the directions that their conversation took really resonated with me.&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;Alan throws the first punch – He likes Herding Code because it’s about real software development rather than development in the Microsoft bubble.  It’s about the tool users rather than the tool builders and it’s about honest feedback.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;As administrators, we need to make sure the developers of the applications that we use and administer provide us the tools we &lt;strong&gt;need&lt;/strong&gt; to efficiently run our networks.  Microsoft has gotten the message loud and clear.  Windows 7, Server 2008 R2, and TechEd 2009 LA confirmed that.  There weren’t many sessions where you didn’t hear something about PowerShell and there aren’t many products where PowerShell isn’t making inroads into the management structure.&lt;/p&gt;
&lt;p&gt;Kudos to Jeffrey Snover and the awesome management technologies team for really selling this internally at Microsoft.&lt;/p&gt;
&lt;p&gt;Another point made on the podcast was that Microsoft needed to do more to encourage better development practices… Can those same developers say that their products encourage better application management practices?&lt;/p&gt;
&lt;p&gt;Now, we as the&lt;strong&gt; users&lt;/strong&gt; of PowerShell &lt;strong&gt;need to step up&lt;/strong&gt; and &lt;span style="text-decoration: line-through;"&gt;convince&lt;/span&gt; demand better administrative tooling from our vendors and internal development staffs.  Companies like &lt;a href="http://www.quest.com/" target="_blank"&gt;Quest&lt;/a&gt;, &lt;a href="http://www.vmware.com/" target="_blank"&gt;VMWare&lt;/a&gt;, &lt;a href="http://www.idera.com/" target="_blank"&gt;Idera&lt;/a&gt;,  &lt;a href="http://www.compellent.com/" target="_blank"&gt;Compellent&lt;/a&gt;, and others have gotten the message, but there are still many, many other products out there and many internal applications that suffer from inflexibility.&lt;/p&gt;
&lt;p&gt;Web interfaces and GUI tools are nice and can be considered the icing on the cake.  A true manageable application allows for consistent and repeatable actions in an easy to maintain structure, as well as providing flexibility to integrate other potential solutions.  PowerShell provides a lot of that right in the box and allows administrators to bridge the gap and create their own solutions that might not have been supported yet (ever hear &amp;#8211; “it’s in the next version”).&lt;/p&gt;
&lt;p&gt;So, here is the call to action:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Rise up and demand proper administrative interfaces.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Talk to your managers about the benefits of streamlined application management using a consistent interface across multiple platforms and applications.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Take a developer to lunch and explain how you want to help make using his product a better experience from the application management side.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Let’s take our cue from the oft repeated concept in that &lt;a href="http://herdingcode.com" target="_blank"&gt;Herding Code&lt;/a&gt; podcast – there is a need for candid feedback and it is all about the tools that we have to live in and work with every day.&lt;/p&gt;
&lt;p&gt;If by chance one of the guys from the Herding Code podcast (or any other developer-centric podcast like &lt;a href="http://dotnetrocks.com/" target="_blank"&gt;.NET Rocks&lt;/a&gt;, &lt;a href="http://deepfriedbytes.com/" target="_blank"&gt;Deep Fried Bytes&lt;/a&gt;, or &lt;a href="http://blog.stackoverflow.com/" target="_blank"&gt;StackOverflow&lt;/a&gt;) happens onto this post and wants to talk further, I’m available.  There are also a good number of PowerShell MVPs and community bloggers who I’m sure would love to provide some “candid feedback” to “developers in the trenches doing real development”.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/akKZuBlFTa9c_zhfYOORAlA7qiU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/akKZuBlFTa9c_zhfYOORAlA7qiU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/akKZuBlFTa9c_zhfYOORAlA7qiU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/akKZuBlFTa9c_zhfYOORAlA7qiU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/UsePowershell?a=oR03OIrDwbw:KczJAlWFPhA:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/UsePowershell?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/UsePowershell/~4/oR03OIrDwbw" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://blog.usepowershell.com/2009/07/dear-devs-give-us-the-tools-k-thx/#comments" thr:count="2" />
		<link rel="replies" type="application/atom+xml" href="http://blog.usepowershell.com/2009/07/dear-devs-give-us-the-tools-k-thx/feed/atom/" thr:count="2" />
		<thr:total>2</thr:total>
	<feedburner:origLink>http://blog.usepowershell.com/2009/07/dear-devs-give-us-the-tools-k-thx/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Steven Murawski</name>
						<uri>http://www.usepowershell.com</uri>
					</author>
		<title type="html"><![CDATA[More PowerShell on the Thirsty Developer]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/UsePowershell/~3/FjazcPnJhuA/" />
		<id>http://blog.usepowershell.com/2009/06/more-powershell-on-the-thirsty-developer/</id>
		<updated>2009-06-07T15:22:51Z</updated>
		<published>2009-06-07T15:22:51Z</published>
		<category scheme="http://blog.usepowershell.com" term="Development" /><category scheme="http://blog.usepowershell.com" term="General" /><category scheme="http://blog.usepowershell.com" term="PowerShell" />		<summary type="html"><![CDATA[Larry Clarkin asked me back on the Thirsty Developer to continue talking about development and PowerShell.&#160; We talked about creating cmdlets, hosting PowerShell, and a bit about Version 2.&#160; Check it out here.
]]></summary>
		<content type="html" xml:base="http://blog.usepowershell.com/2009/06/more-powershell-on-the-thirsty-developer/">&lt;p&gt;&lt;a href="http://eraserandcrowbar.com/" target="_blank"&gt;Larry Clarkin&lt;/a&gt; asked me back on the &lt;a href="http://thirstydeveloper.com" target="_blank"&gt;Thirsty Developer&lt;/a&gt; to continue talking about development and PowerShell.&amp;#160; We talked about creating cmdlets, hosting PowerShell, and a bit about Version 2.&amp;#160; &lt;a href="http://thirstydeveloper.com/2009/06/01/64MoreOnPowershell.aspx" target="_blank"&gt;Check it out here.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/BAVwLkzLwkC-vRyBWwvrNuVjySk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/BAVwLkzLwkC-vRyBWwvrNuVjySk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/BAVwLkzLwkC-vRyBWwvrNuVjySk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/BAVwLkzLwkC-vRyBWwvrNuVjySk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/UsePowershell?a=FjazcPnJhuA:aJI-tajJfdQ:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/UsePowershell?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/UsePowershell/~4/FjazcPnJhuA" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://blog.usepowershell.com/2009/06/more-powershell-on-the-thirsty-developer/#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://blog.usepowershell.com/2009/06/more-powershell-on-the-thirsty-developer/feed/atom/" thr:count="0" />
		<thr:total>0</thr:total>
	<feedburner:origLink>http://blog.usepowershell.com/2009/06/more-powershell-on-the-thirsty-developer/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Steven Murawski</name>
						<uri>http://www.usepowershell.com</uri>
					</author>
		<title type="html"><![CDATA[Response: Give Me A Coconut and Six Months]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/UsePowershell/~3/jxe39Z8VhsU/" />
		<id>http://blog.usepowershell.com/2009/06/response-give-me-a-coconut-and-six-months/</id>
		<updated>2009-06-05T20:57:48Z</updated>
		<published>2009-06-05T19:31:59Z</published>
		<category scheme="http://blog.usepowershell.com" term="General" /><category scheme="http://blog.usepowershell.com" term="PowerShell" /><category scheme="http://blog.usepowershell.com" term="SQL" /><category scheme="http://blog.usepowershell.com" term="Systems Administration" />		<summary type="html"><![CDATA[I was tagged by SQL Server Expert Brent Ozar in his response to a great, thought provoking blog post called Give Me a Coconut and Six Months by Tim Ford (SQLAgentMan on Twitter).
The short summary of the post is if you had six months free of distraction, what would you turn your attention to.&#160; Tim’s [...]]]></summary>
		<content type="html" xml:base="http://blog.usepowershell.com/2009/06/response-give-me-a-coconut-and-six-months/">&lt;p&gt;I was &lt;a href="http://www.brentozar.com/archive/2009/06/give-me-a-coconut-and-six-months/" target="_blank"&gt;tagged&lt;/a&gt; by &lt;a href="http://www.brentozar.com" target="_blank"&gt;SQL Server Expert Brent Ozar&lt;/a&gt; in his response to a great, thought provoking blog post called &lt;a href="http://www.ford-it.com/sqlagentman/?p=268" target="_blank"&gt;Give Me a Coconut and Six Months&lt;/a&gt; by &lt;a href="http://www.ford-it.com/sqlagentman" target="_blank"&gt;Tim Ford&lt;/a&gt; (&lt;a href="http://twitter.com/sqlagentman" target="_blank"&gt;SQLAgentMan on Twitter&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;The short summary of the post is if you had six months free of distraction, what would you turn your attention to.&amp;#160; Tim’s choices included backups, security, and monitoring, which I think is a great “solid foundation” to work from.&lt;/p&gt;
&lt;p&gt;Brent posits that if he became more effective at data mining, he would be able to provide a business with critical insight with which to improve sales, product focus, and develop key personnel.&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;If I had more time (and skills), I could tell executives things like:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;These are the top five customers who are about to leave us. &lt;/li&gt;
&lt;li&gt;These are the top five products that are about to go viral, and we need to stock more ASAP. &lt;/li&gt;
&lt;li&gt;These are the top five salespeople who need coaching to produce more revenue. &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Walk into an executive’s office with this kind of information, and you’re a hero.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Here’s the shocker Brent… I agree.&amp;#160; &lt;/p&gt;
&lt;p&gt;I agree that delivering that kind of data to management is the Holy Grail of IT projects.&amp;#160; Before coming into the IT realm, I ran a small business and I would have killed for information along those lines.&amp;#160; &lt;/p&gt;
&lt;p&gt;One thing I think is missing from Brent’s discussion is that there are three parts to this type of data mining:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The first part is the technical aspect on how to retrieve the data from databases and other sources of information, which Brent probably has handily covered.&amp;#160; &lt;/li&gt;
&lt;li&gt;The second part is not a technical question at all.&amp;#160; The second part of the data mining is actually coming up with questions you have for your data.&amp;#160; The quote above from Brent’s post highlights those, and point to an area of expertise outside the technical.&amp;#160; Brent is demonstrating (and probably should have said explicitly) that a domain/business knowledge is very important in determining these requests.&amp;#160; This is often difficult for the stereotypical IT person, but is essential if you are interested in moving your career past a technical implementer.&amp;#160; &lt;/li&gt;
&lt;li&gt;So, it appears Brent’s real goal is the the third part of this process, which is translating these questions (taking the business knowledge) and retrieving and correlating the data (using his technical skills) that he will need to make these determinations.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Brent continues on to cover a common area of disagreement between us.&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;I kick the PowerShell horse a lot, and here it comes again. If you’re in IT, listen up: you’re either cutting costs, or making money.&amp;#160; Guess which one has more upside.&amp;#160; If you truly bust your hump, become an amazing scripting deity, and save 99% of your time, you just saved 99% of your salary.&amp;#160; If you’re really good, you might save 10 people 99% of their time.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I work as the sole admin/accidental DBA/desktop support/multimedia support/”if it has a blinking LED light” support for an agency that collects lots and lots of data.&amp;#160; As a scripting practitioner, if I save myself 25%, 40%, or even 60% of my time not having to solve the same problems over and over, I’m free to plume the mysteries of my database and convert the bits stored their into meaningful data and even information that is usable and actionable.&amp;#160; &lt;/p&gt;
&lt;p&gt;Not every environment has the luxury of being able to afford someone of Brent’s caliber to come in and learn their business and help them develop methods of turning their data into knowledge.&amp;#160; In my situation and that of many small to medium businesses, scripting is the tool that enables the IT generalist to explore and branch out into these other areas. &lt;/p&gt;
&lt;p&gt;Brent may feel ” you can go into data mining and make 100 salespeople twice as effective” and that IT people who keep things running are replaceable and he may be right, but I believe, especially in tighter economic times, specialists become a luxury that only a few can afford where efficient generalists that know the business become more in demand.&lt;/p&gt;
&lt;p&gt;Don’t be mad Brent… it’s okay to be wrong every once in a while! &lt;img src='http://blog.usepowershell.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /&gt; &lt;/p&gt;
&lt;p&gt;So if I had six months of no interruptions and could focus on certain specific projects, I would:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Finish automating (via PowerShell, SQL, or other means) common tasks&lt;/li&gt;
&lt;li&gt;Develop the questions my administrators (not technical admins, but departmental administrators) would like to ask our data sources&lt;/li&gt;
&lt;li&gt;Build tools to answer those questions via reports, graphs, network maps, or other data visualization techniques (like the cool stuff &lt;a href="http://dougfinke.com/blog/?cat=185" target="_blank"&gt;Doug Finke&lt;/a&gt; and &lt;a href="http://chadwickmiller.spaces.live.com/blog/cns!EA42395138308430!434.entry" target="_blank"&gt;Chad Miller&lt;/a&gt; have been doing)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I personally think that EVERY technical person should have a grasp on the basic business environment, be aware of what is happening in their company’s industry (or at least their department’s industry for larger organizations), and begin to develop more in depth domain knowledge as to the business processes.&lt;/p&gt;
&lt;p&gt;Due to the odd path I took to becoming an IT person, I’ve actually accumulated quite a bit of domain knowledge about the law enforcement, the various jobs, information requirements, and the ins and outs of our workflows and data.&amp;#160; This background gives me a great starting place when going to look at my data, since scripting has given me the time to do so.&amp;#160; &lt;/p&gt;
&lt;p&gt;Judging from the pattern in Tim’s and Brent’s posts, I’m supposed to tag a few people..&lt;/p&gt;
&lt;p&gt;How about:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://dougfinke.com/blog/" target="_blank"&gt;Doug Finke&lt;/a&gt; (developer, data visualization explorer,&amp;#160; and PowerShell MVP), &lt;/li&gt;
&lt;li&gt;&lt;a href="http://halr9000.com/" target="_blank"&gt;Hal Rottenberg&lt;/a&gt; (administrator, VMWare vExpert, podcaster, and PowerShell MVP),&lt;/li&gt;
&lt;li&gt;and &lt;a href="http://fatbeards.blogspot.com/" target="_blank"&gt;Wes Stahler&lt;/a&gt; (administrator, blogger, and PowerShell enthusiast)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/mGOxhr5CTcbgCd1_s3yPGGQD6es/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/mGOxhr5CTcbgCd1_s3yPGGQD6es/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/mGOxhr5CTcbgCd1_s3yPGGQD6es/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/mGOxhr5CTcbgCd1_s3yPGGQD6es/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/UsePowershell?a=jxe39Z8VhsU:hPR3x7EbupM:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/UsePowershell?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/UsePowershell/~4/jxe39Z8VhsU" height="1" width="1"/&gt;</content>
		<link rel="replies" type="text/html" href="http://blog.usepowershell.com/2009/06/response-give-me-a-coconut-and-six-months/#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://blog.usepowershell.com/2009/06/response-give-me-a-coconut-and-six-months/feed/atom/" thr:count="0" />
		<thr:total>0</thr:total>
	<feedburner:origLink>http://blog.usepowershell.com/2009/06/response-give-me-a-coconut-and-six-months/</feedburner:origLink></entry>
	</feed>
