<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>

<channel>
	<title>musc@> $daniele.rant &#124; Out-Blog &#187; PowerShell</title>
	<atom:link href="http://www.muscetta.com/category/powershell/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.muscetta.com</link>
	<description>Superior Dedication - Specialization is bullshit.</description>
	<pubDate>Tue, 26 Aug 2008 16:55:12 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.1</generator>
	<language>en</language>
			<item>
		<title>Conversation about Blogs with a customer</title>
		<link>http://www.muscetta.com/2008/03/28/conversation-about-blogs-with-a-customer/</link>
		<comments>http://www.muscetta.com/2008/03/28/conversation-about-blogs-with-a-customer/#comments</comments>
		<pubDate>Fri, 28 Mar 2008 14:24:17 +0000</pubDate>
		<dc:creator>Daniele Muscetta</dc:creator>
		
		<category><![CDATA[Blogs]]></category>

		<category><![CDATA[Choice]]></category>

		<category><![CDATA[Funny]]></category>

		<category><![CDATA[Integration]]></category>

		<category><![CDATA[Microsoft]]></category>

		<category><![CDATA[OpsMgr2007]]></category>

		<category><![CDATA[PowerShell]]></category>

		<category><![CDATA[Rant]]></category>

		<category><![CDATA[Tools]]></category>

		<category><![CDATA[gapingvoid]]></category>

		<guid isPermaLink="false">http://www.muscetta.com/2008/03/28/conversation-about-blogs-with-a-customer/</guid>
		<description><![CDATA[I usually don&#039;t like mentioning specific facts that happened to me at work. But work is part of life, so even if this is mostly a personal blog, I cannot help myself but write about certain things that make me think when they happen.
When I end up having conversations such as this, I get really [...]]]></description>
			<content:encoded><![CDATA[<p>I usually don&#039;t like mentioning specific facts that happened to me at work. But work is part of life, so even if this is mostly a personal blog, I cannot help myself but write about certain things that make me think when they happen.</p>
<p>When I end up having conversations such as this, I get really sad: I thought we had finally passed the arrogant period where we had to spoon-feed customers, and I thought we were now mature enough to consider them smart people and providing <a href="http://www.microsoft.com/powershell">cool, empowering technologies</a> for them to use. I also thought that pretty much everybody liked Microsoft finally opening up and actually talking TO people&#8230; not only talking them INTO buying something, something - but having real conversations.</p>
<p>I get sad when I find that people still don&#039;t seem to be accepting that, and wanting back the old model, instead. Kinda weird.</p>
<p>&nbsp;</p>
<p>The conversation goes as follows (words are not exactly those - we were speaking Italian and I sort of reconstructed the conversation - you should get the sense of it anyway):</p>
<p>&nbsp;</p>
<blockquote><p>[...]</p>
<p><strong>Me:</strong> &#034;The SDK service allows you to do quite a lot of cool stuff. Unfortunately not all of that functionality is completely or always easily exposed in the GUI. That is, for example: it is very EASY to define overrides, but it can get very tricky to find them back once set. That&#039;s why you can use <a href="http://blogs.msdn.com/boris_yanushpolsky/archive/2007/08/09/override-explorer-v3-3.aspx">this little useful tool</a> that the developer of that SDK service has posted on his blog&#8230;&#034; </p>
<p><strong>Cust:</strong> &#034;&#8230;but we can&#039;t just read blogs here and there!&#034; </p>
<p><strong>Me:</strong> &#034;Well, I mean, then you may have to wait for the normal release cycle. It might be that those improvements will make it in to the product. That might happen in months, if you are lucky, or maybe never. What&#039;s wrong if he publishes that on his blog, bypassing the bureaucracy crap, and makes your life easier with it RIGHT NOW?&#034; </p>
<p><strong>Cust:</strong> &#034;It is not official, I want it in the product!&#034; </p>
<p><strong>Me:</strong> &#034;I see, and even understand that. But right now that feature just isn&#039;t there. But you can use this tool to have it. Don&#039;t worry: it is not made by some random guy who wants to trojan your server! It is made by the very same developer who wrote the product itself&#8230;&#034; </p>
<p><strong>Cust:</strong> &#034;It is not supported, what if it breaks something?&#034; </p>
<p><strong>Me: </strong>&#034;So are all resource kit tools, in general. written by some dev guy in his free five minutes, and usually unsupported. Still very useful, though. Most of them. And they usually do work, you know that much, don&#039;t you?&#034; </p>
<p><strong>Cust:</strong> &#034;But why on a blog?&#034; </p>
<p><strong>Me:</strong> &#034;What&#039;s wrong with this? People are just trying to make customer&#039;s life easier by <a href="http://www.gapingvoid.com/Moveable_Type/archives/001607.html">being transparent and open and direct in their communication, just talking RIGHT to the customers. People talking to people</a>, bypassing the prehistoric bureaucracy structure of companies&#8230; the same happens on many other sites, just think <a href="http://isatools.org/">isatools.org</a> for example&#8230; those are just tools that a support guy like me has written and wants to share because they might be useful&#8230;&#034; </p>
<p><strong>Cust:</strong> &#034;But I can&#039;t follow/read all the blogs out there! I don&#039;t have time for it&#034; </p>
<p><strong>Me:</strong> &#034;Why not? I have thousands of feeds in my aggregator and&#8230;&#034; </p>
<p><strong>Cust:</strong> &#034;I don&#039;t have time and I don&#039;t want to read them, because I pay for support, so I don&#039;t expect this stuff to be in blogs&#034; </p>
<p><strong>Me:</strong> &#034;Well, I see, since you pay for support, you are paying ME - in fact I am working with you on this product precisely as part of that paid support. That&#039;s why I am here to tell you that this tool exists, in case you had not heard of it, so you actually know about it without having to read that yourself on any blog&#8230; does that sound like a deal? Where&#039;s the issue?&#034; </p>
<p><strong>Cust:</strong> &#034;Sgrunt. I want something official, I don&#039;t like this blog stuff&#034; </p>
<p>[...]</p>
</blockquote>
<p>&nbsp;</p>
<p>I thought this was particularly interesting, not because I want to make fun of this person. I do respect him and I think he just has a different point of view. But in my opinion this conversation shows (and made me think about) an aspect of that &#034;generation gap&#034; inside Microsoft that <a href="http://www.gapingvoid.com/Moveable_Type/archives/004459.html">Hugh talks about here</a>: </p>
<blockquote><p><em>&#034;[...]4.30 Hugh talks about a conversation he had with a few people inside Microsoft- how there’s a generation gap growing within the company, between the Old Guard, and the new generation of Microsofties, who see their company in much more open, organic terms.[...]&#034;</em> </p>
</blockquote>
<p>Basically this tells me that the generation gap is not happening only INSIDE Microsoft: it invests our customers too. Which makes it even more <a href="http://www.gapingvoid.com/Moveable_Type/archives/004181.html">difficult to talk to some of them, as we change</a>. Traditions are hard to change.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.muscetta.com/2008/03/28/conversation-about-blogs-with-a-customer/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Looking at OpsMgr2007 Alert trend with Command Shell</title>
		<link>http://www.muscetta.com/2008/01/25/looking-at-opsmgr2007-alert-trend-with-command-shell/</link>
		<comments>http://www.muscetta.com/2008/01/25/looking-at-opsmgr2007-alert-trend-with-command-shell/#comments</comments>
		<pubDate>Fri, 25 Jan 2008 20:01:02 +0000</pubDate>
		<dc:creator>Daniele Muscetta</dc:creator>
		
		<category><![CDATA[Coding]]></category>

		<category><![CDATA[ITVC]]></category>

		<category><![CDATA[MOM]]></category>

		<category><![CDATA[Microsoft]]></category>

		<category><![CDATA[OpsMgr2007]]></category>

		<category><![CDATA[PowerShell]]></category>

		<category><![CDATA[System Center Operations Manager 2007]]></category>

		<category><![CDATA[Tools]]></category>

		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.muscetta.com/2008/01/25/looking-at-opsmgr2007-alert-trend-with-command-shell/</guid>
		<description><![CDATA[It&#039;s friday night, I am quite tired and I can&#039;t be asked of writing a long post. But I have not written much all week, not even updated my Twitter, and now I want to finish the week with at least some goodies. So this is the turn of a couple of Powershell commands/snippets/scripts that [...]]]></description>
			<content:encoded><![CDATA[<p>It&#039;s friday night, I am quite tired and I can&#039;t be asked of writing a long post. But I have not written much all week, not even updated my Twitter, and now I want to finish the week with at least some goodies. So this is the turn of a couple of <a href="http://www.microsoft.com/powershell">Powershell</a> commands/snippets/scripts that will count alerts and events generated each day: this information could help you understand the trends of events and alerts over time in a Management Group. It is nothing fancy at all, but they can still be useful to someone out there. In the past (MOM 2005) I used to gather this kind of information with SQL Queries against the operations database. But now, with Powershell, everything is exposed as objects and it is much easier to get information without really getting your hands dirty with the database <img src='http://www.muscetta.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p><strong>#Number of Alerts per day</strong></p>
<p><em>$alerttimes = Get-Alert | Select-Object TimeRaised<br />
$array=@() </em></p>
<p><em>foreach ($datetime in $alerttimes){<br />
$array += $datetime.timeraised.date<br />
} </em></p>
<p><em>$array | Group-Object Date</em></p>
<p><strong>#Number of Events per day</strong></p>
<p><em>$eventtimes = Get-Event | Select-Object TimeGenerated<br />
$array=@() </em></p>
<p><em>foreach ($datetime in $eventtimes){<br />
$array += $datetime.timegenerated.date<br />
} </em></p>
<p><em>$array | Group-Object Date</em></p>
<p>Beware that these &#034;queries&#034; might take a long time to execute (especially the events one) depending on the amount of data and your retention policy.</p>
<p>This is of course just scratching the surface of the amount of amazing things you can do with Powershell in Operations Manager 2007. For this kind of information you might want to keep an eye on the official &#034;System Center Operations Manager Command Shell&#034; blog: <a href="http://blogs.msdn.com/scshell/" title="http://blogs.msdn.com/scshell/">http://blogs.msdn.com/scshell/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.muscetta.com/2008/01/25/looking-at-opsmgr2007-alert-trend-with-command-shell/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Get-FlickrPhotos</title>
		<link>http://www.muscetta.com/2008/01/14/get-flickrphotos/</link>
		<comments>http://www.muscetta.com/2008/01/14/get-flickrphotos/#comments</comments>
		<pubDate>Mon, 14 Jan 2008 21:46:50 +0000</pubDate>
		<dc:creator>Daniele Muscetta</dc:creator>
		
		<category><![CDATA[Blogs]]></category>

		<category><![CDATA[Choice]]></category>

		<category><![CDATA[Coding]]></category>

		<category><![CDATA[Cross Post]]></category>

		<category><![CDATA[Flickr]]></category>

		<category><![CDATA[ITVC]]></category>

		<category><![CDATA[Interop]]></category>

		<category><![CDATA[PowerShell]]></category>

		<category><![CDATA[Tools]]></category>

		<category><![CDATA[dotNet]]></category>

		<guid isPermaLink="false">http://www.muscetta.com/2008/01/14/get-flickrphotos/</guid>
		<description><![CDATA[A while ago, talking to some friends, I was mentioning how cool it was that Flickr provides APIs, so that you can always get your data out of it, if you want to. There are several downloader applications that I found on the Internet, but I have not yet chosen one that I completey like [...]]]></description>
			<content:encoded><![CDATA[<p>A while ago, talking to some friends, I was mentioning how cool it was that <a href="http://www.flickr.com/services/api">Flickr provides APIs</a>, so that you can always get your data out of it, if you want to. There are several downloader applications that I found on the Internet, but I have not yet chosen one that I completey like among the few that I&#039;ve tried. So, inspired by <a href="http://kosso.wordpress.com/2007/01/31/free-php5-script-to-grab-your-flickr-photos/">Kosso&#039;s PHP script for enumerating your photos on Flickr</a>, I thought I&#039;d port it to <a href="http://www.microsoft.com/powershell">Powershell</a> and make my own version of it. Just for the fun of it. My Powershell script does not do everything that Kosso&#039;s one does: I don&#039;t build a web page showing description and comments. I suppose this is because the original script was made with PHP, which you usually run on a web server and outputting as HTML is the standard thing you would do in PHP. I just concentrated on the &#034;download&#034; thing, since mine it is a console script. You can think of mine as a &#034;full backup&#034; script. Full&#8230; well, at least of all your photos, if not of all the metadata. It should be trivial to extend anyway, also considering Powershell XML type accelerator really makes it extremely easy to parse the output of a <a href="http://www.flickr.com/services/api/request.rest.html">REST API such as Flickr&#039;s</a> (I would say even easier and more readable that PHP&#039;simplexml). There is a ton of things that could be extended/improved in the script&#8230; including supporting proxy servers, accepting more parameters for things that are now hardcoded&#8230; and with a million other things. Even this way, though, I think that the script can be useful to show a number of techniques in Powershell. Or just to download your photos <img src='http://www.muscetta.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> So you can download the script from here: <a href="http://www.muscetta.org/Get-FlickrPhotos.ps1.txt">Get-FlickrPhotos.ps1</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.muscetta.com/2008/01/14/get-flickrphotos/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Welcome www.powershell.it!</title>
		<link>http://www.muscetta.com/2008/01/04/welcome-wwwpowershellit/</link>
		<comments>http://www.muscetta.com/2008/01/04/welcome-wwwpowershellit/#comments</comments>
		<pubDate>Fri, 04 Jan 2008 21:35:50 +0000</pubDate>
		<dc:creator>Daniele Muscetta</dc:creator>
		
		<category><![CDATA[Blogs]]></category>

		<category><![CDATA[Choice]]></category>

		<category><![CDATA[Coding]]></category>

		<category><![CDATA[Cross Post]]></category>

		<category><![CDATA[ITVC]]></category>

		<category><![CDATA[Integration]]></category>

		<category><![CDATA[Interop]]></category>

		<category><![CDATA[Links]]></category>

		<category><![CDATA[Microsoft]]></category>

		<category><![CDATA[PowerShell]]></category>

		<category><![CDATA[Tools]]></category>

		<category><![CDATA[Windows]]></category>

		<category><![CDATA[dotNet]]></category>

		<guid isPermaLink="false">http://www.muscetta.com/2008/01/04/welcome-wwwpowershellit/</guid>
		<description><![CDATA[I just read from Jeffrey Snover about this newly born Italian PowerShell community site.
I just created an account for myself on the site&#8230; as you know I like PowerShell, so even if I usually prefer writing stuff in english, I will try to hang out there and see how can I contribute to it.
After all, [...]]]></description>
			<content:encoded><![CDATA[<p>I <a href="http://blogs.msdn.com/powershell/archive/2008/01/04/www-powershell-it-italian-powershell-community-website.aspx">just read from Jeffrey Snover</a> about this newly born <a href="http://www.powershell.it/">Italian PowerShell community site</a>.</p>
<p>I just created an account for myself on the site&#8230; as you know <a href="http://www.muscetta.com/category/powershell/">I like PowerShell</a>, so even if I usually prefer writing stuff in english, I will try to hang out there and see how can I contribute to it.</p>
<p>After all, I am italian&#8230; <img src='http://www.muscetta.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.muscetta.com/2008/01/04/welcome-wwwpowershellit/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Simply Works</title>
		<link>http://www.muscetta.com/2007/12/27/simply-works/</link>
		<comments>http://www.muscetta.com/2007/12/27/simply-works/#comments</comments>
		<pubDate>Thu, 27 Dec 2007 18:24:27 +0000</pubDate>
		<dc:creator>Daniele Muscetta</dc:creator>
		
		<category><![CDATA[Blogs]]></category>

		<category><![CDATA[Choice]]></category>

		<category><![CDATA[Coding]]></category>

		<category><![CDATA[Energy]]></category>

		<category><![CDATA[Facebook]]></category>

		<category><![CDATA[ITVC]]></category>

		<category><![CDATA[MOM]]></category>

		<category><![CDATA[MOM2005]]></category>

		<category><![CDATA[Microsoft]]></category>

		<category><![CDATA[OpsMgr2007]]></category>

		<category><![CDATA[Personal]]></category>

		<category><![CDATA[Photos]]></category>

		<category><![CDATA[PowerShell]]></category>

		<category><![CDATA[Rant]]></category>

		<category><![CDATA[Risk]]></category>

		<category><![CDATA[System Center Operations Manager 2007]]></category>

		<category><![CDATA[Tools]]></category>

		<category><![CDATA[lifestream]]></category>

		<guid isPermaLink="false">http://www.muscetta.com/2007/12/27/simply-works/</guid>
		<description><![CDATA[
Simply Works, uploaded by Daniele Muscetta on Flickr.
I don&#039;t know about other people, but I do get a lot to think when the end of the year approaches: all that I&#039;ve done, what I have not yet done, what I would like to do, and so on&#8230;
And it is a period when memories surface.
I found [...]]]></description>
			<content:encoded><![CDATA[<p class="flickr-frame"><a title="photo sharing" href="http://www.flickr.com/photos/dani3l3/2141526220/"><img src="http://farm3.static.flickr.com/2222/2141526220_7754fa3134.jpg" alt="Simply Works" class="flickr-photo" /></a></p>
<p><span class="flickr-caption"><a href="http://www.flickr.com/photos/dani3l3/2141526220/">Simply Works</a>, uploaded by <a href="http://www.flickr.com/people/dani3l3/">Daniele Muscetta</a> on Flickr.</span></p>
<p class="flickr-yourcomment">I don&#039;t know about other people, but I do get a lot to think when the end of the year approaches: all that I&#039;ve done, what I have not yet done, what I would like to do, and so on&#8230;</p>
<p>And it is a period when memories surface.</p>
<p>I found the two old CD-ROMs you can see in the picture. And those are memories.<br />
missioncritical software was the company that invented a lot of stuff that became Microsoft&#039;s products: for example <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=6f86937b-533a-466d-a8e8-aff85ad3d212&amp;displaylang=en">ADMT</a> and <a href="http://www.microsoft.com/systemcenter/opsmgr/default.mspx">Operations Manager</a>.</p>
<p>The black CD contains SeNTry, the &#034;enterprise event manager&#034;, what later became Operations Manager.<br />
On the back of the CD, the company motto at the time: &#034;software that works simply and simply works&#034;.<br />
So true. I might digress on this concept, but I won&#039;t do that right now.</p>
<p>I have already explained in my other blog <a href="http://blogs.msdn.com/dmuscett/archive/2005/09/02/459914.aspx">what I do for work</a>. Well, that was a couple of years ago anyway. Several things have changed, and we are moving towards offering services that are more measurable and professional. So, since it happens that in a certain job you need to be an &#034;expert&#034; and &#034;specialize&#034; in order to be &#034;seen&#034; or &#034;noticed&#034;.<br />
You know <a href="http://www.muscetta.com/2006/05/29/specialization-is-bullshit/">I don&#039;t really believe in specialization</a>. I have written it <a href="http://www.muscetta.com/2006/11/05/more-on-specialization/">all over the place</a>. But you need to make other people happy as well and let them believe what they want, so when you &#034;specialize&#034; they are happier. No, really, it might make a difference in your carrer <img src='http://www.muscetta.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>In this regard, I did also mention my <a href="http://blogs.msdn.com/dmuscett/archive/2004/11/18/263280.aspx">&#034;meeting again&#034; with Operations Manager</a>.<br />
That&#039;s where Operations manager helped me: it let me &#034;specialize&#034; in systems and applications management&#8230; a field where you need to know a bit of everything anyway: infrastructure, security, logging, scripting, databases, and so on&#8230; <img src='http://www.muscetta.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /><br />
This way, everyone wins.</p>
<p>Don&#039;t misunderstand me, this does not mean I want to know everything. One cannot possibly know everything, and the more I learn the more I believe I know nothing at all, to be honest. I don&#039;t know everything, <a href="http://thedailywtf.com/Articles/Classic-WTF-Lock-In-Key-Security.aspx">so please don&#039;t ask me everything - I work with mainframes</a> <img src='http://www.muscetta.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /><br />
While that can be a great excuse to avoid neighbours and relatives annoyances with their PCs though, on the serious side I still believe that any intelligent individual cannot be locked into doing a narrow thing and know only that one bit just because it is common thought that you have to act that way.</p>
<p>If I would <a href="http://twitter.com/gapingvoid/statuses/535752142">stop where I have to stop</a> I would be the standard &#034;IT Pro&#034;. I would be fine, sure, but I would get bored soon. I would not learn anything. <a href="http://www.muscetta.com/2007/09/11/itpro-vs-dev-there-is-no-such-a-thing/">But I don&#039;t feel I am the standard &#034;IT Pro&#034;</a>. In fact, funnily enough, <a href="http://www.google.com/search?hl=en&amp;q=link:www.muscetta.com&amp;btnG=Search">on some other blogs out there I have been referenced as a &#034;Dev&#034;</a> (find it on your own, look at their blogrolls :-)). But I am not a Dev either then&#8230; I don&#039;t write code for work. I would love to, but I rarely actually do, other than some scripts. Anyway, I tend to escape the definition of the usual &#034;expert&#034; on something&#8230; mostly because I want to escape it. I don&#039;t see myself represented by those generalization.</p>
<p>As <a href="http://haacked.com/archive/2007/12/21/faceoff-haack-vs-hanselman-it-gets-real.aspx">Phil puts it</a>, when asked &#034;Are software developers - engineers or artists?&#034;:</p>
<blockquote><p>&#034;[...] Don’t take this as a copout, but a little of both. I see it more as craftsmanship. Engineering relies on a lot of science. Much of it is demonstrably empirical and constrained by the laws of physics. Software is less constrained by physics as it is by the limits of the mind. [...]&#034;</p></blockquote>
<p>Craftmanship. Not science.<br />
And stop calling me an &#034;engineer&#034;. I am not an engineer. I was even crap in math, in school!</p>
<p>Anyway, what does this all mean? In practical terms, it means that in the end, wether I want it or not, I do get considered an &#034;expert&#034; on MOM and OpsMgr&#8230; and that I will mostly work on those products for the next year too. But that is not bad, because, as I said, working on that product means working on many more things too. Also, I can point to different audiences: those believing in &#034;experts&#034; and those going beyond schemes. It also means that I will have to continue teaching a couple of scripting classes (both VBScript and PowerShell) that nobody else seems to be willing to do (because they are all *expert* in something narrow), and that I will still be hacking together my other stuff (my facebook apps, my wordpress theme and plugins, my server, etc) and even continue to have strong opinions in those other fields that I find interesting and where I am not considered an *expert* <img src='http://www.muscetta.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>Well, I suppose I&#039;ve been ranting enough for today&#8230;and for this year <img src='http://www.muscetta.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /><br />
I really want to wish everybody again a great beginning of 2008!!! What are you going to be busy with, in 2008 ?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.muscetta.com/2007/12/27/simply-works/feed/</wfw:commentRss>
		</item>
		<item>
		<title>ITPro vs. Dev: there is no such a thing.</title>
		<link>http://www.muscetta.com/2007/09/11/itpro-vs-dev-there-is-no-such-a-thing/</link>
		<comments>http://www.muscetta.com/2007/09/11/itpro-vs-dev-there-is-no-such-a-thing/#comments</comments>
		<pubDate>Tue, 11 Sep 2007 19:05:49 +0000</pubDate>
		<dc:creator>Daniele Muscetta</dc:creator>
		
		<category><![CDATA[Blogs]]></category>

		<category><![CDATA[Choice]]></category>

		<category><![CDATA[Coding]]></category>

		<category><![CDATA[Cross Platform]]></category>

		<category><![CDATA[Integration]]></category>

		<category><![CDATA[Microsoft]]></category>

		<category><![CDATA[Personal]]></category>

		<category><![CDATA[PowerShell]]></category>

		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.muscetta.com/2007/09/11/itpro-vs-dev-there-is-no-such-a-thing/</guid>
		<description><![CDATA[Dave Winer wisely writes:
[...] I&#039;ve been pushing the idea that every app should be a platform for a long time, that in addition to a user interface, every app should have a programmatic interface. For me the idea came from growing up using Unix in the 70s, where every app is a toolkit and the [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.scripting.com/stories/2007/09/10/shouldEveryAppBeAPlatform.html">Dave Winer wisely writes</a>:</p>
<blockquote><p><em>[...] I&#039;ve been pushing the idea that every app should be a platform for a long time, that in addition to a user interface, every app should have a programmatic interface. For me the idea came from growing up <strong>using Unix</strong> in the 70s, <strong>where every app is a toolkit and the operating system is a scripting language</strong>. Wiring things together is an integral part of being a Unix user. It&#039;s why programmers like Unix so much [...]</em></p></blockquote>
<p>It is entirely true. The limits are blurry, IMHO. In the Unix world it is common to find full-fledged &#034;applications&#034; which have been written by the ground up by people that were doing SysAdmin tasks, and those &#034;applications&#034; are usually just&#8230; scripts. Simple shell scripts, or something more evolved (PERL, PHP, Python) it does not really matter.</p>
<p>I am so tired of the division traditionally made in the Microsoft world between &#034;Developers&#034; and &#034;IT Professionals&#034;. We even have separate sites for the two audiences: <a href="http://msdn.microsoft.com">MSDN</a> and <a href="http://technet.microsoft.com">Technet</a>. There are separate &#034;TechED&#034; events: for&#034;<a href="http://www.mseventseurope.com/teched/07/developers/Content/Pages/Default.aspx">Devs</a>&#034; and for &#034;<a href="http://www.mseventseurope.com/teched/07/itforum/Content/Pages/Default.aspx">IT Pros</a>&#034;. There are blogs that are divided among the two &#034;audiences&#034;&#8230;</p>
<p>There aren&#039;t two different audiences, really. There are people, with various degrees of expertise. There is no such a thing as a &#034;developer&#034; if he doesn&#039;t know a bit how the underlying system works. His code is gonna suck. And there is not such a thing such a &#034;IT Pro&#034; that builds and integrates and manages systems if he does not have the palest idea of how things work &#034;behind the GUI&#034;. He&#039;s gonna screw things up regardless of how many step-by-step (click-by-click ?) procedures you spoon feed him.</p>
<p>That&#039;s why automation and integration are best done by people who know how to write a bit code.</p>
<p>The <a href="http://www.microsoft.com/powershell">PowerShell</a> <a href="http://blogs.msdn.com/PowerShell/">folk</a> GET IT.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.muscetta.com/2007/09/11/itpro-vs-dev-there-is-no-such-a-thing/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Powershell and RegExp: a &#8220;match&#8221; made my day.</title>
		<link>http://www.muscetta.com/2007/08/09/powershell-and-regexp-a-match-made-my-day/</link>
		<comments>http://www.muscetta.com/2007/08/09/powershell-and-regexp-a-match-made-my-day/#comments</comments>
		<pubDate>Thu, 09 Aug 2007 18:45:31 +0000</pubDate>
		<dc:creator>Daniele Muscetta</dc:creator>
		
		<category><![CDATA[Coding]]></category>

		<category><![CDATA[Exchange]]></category>

		<category><![CDATA[ISA]]></category>

		<category><![CDATA[ITVC]]></category>

		<category><![CDATA[Microsoft]]></category>

		<category><![CDATA[PowerShell]]></category>

		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://www.muscetta.com/2007/08/09/powershell-and-regexp-a-match-made-my-day/</guid>
		<description><![CDATA[Today I was working with a customer and friend (Claudio Latini, who I thank for the permission to post this, which is also work of his brain - especially the regular expression you&#039;ll see reading on!).
We are running several projects and activities together and, among several other things, he&#039;s in the process of migrating his users from Exchange [...]]]></description>
			<content:encoded><![CDATA[<p>Today I was working with a customer and friend (Claudio Latini, who I thank for the permission to post this, which is also work of his brain - especially the regular expression you&#039;ll see reading on!).</p>
<p>We are running several projects and activities together and, among several other things, he&#039;s in the process of migrating his users from Exchange 2003 to Exchange 2007. In this infrastructure, he has some ISA Server that publish both the Exchange2003 and the Exchange2007 frontends.</p>
<p>Now he wanted to know HOW MANY and WHICH ONES of his users actually have a PocketPC or other WIndows Mobile device and were actively connecting to the old FrontEnd. You give out mobile devices to people but those things are usually less &#034;managed&#034; - when compared to corporate PCs, at least. So you loose a bit control of the thing&#8230; usually people with mobile devices using ActiveSync in companies are managers, and especially since some of them might be on holiday at the moment, it was important to know WHO were the people that had to be told to reconfigure their device to point to the new name/server BEFORE he would start complaining about ActiveSync not working anymore&#8230;</p>
<p>So how do you figure out who&#039;s connecting ?</p>
<p>I am NO Exchange expert whatsoever&#8230; but a thing that came in handy was the thing that an ISA Server was reverse-publishing the frontend server. I know ISA (and firewalls/proxies in general) much better than Exchange, so I can help on that side. In the log files, ActiveSync Connections looked like the following URL, passing most parameters in the POST request: <a title="http://www.company.com/exchange?User=Mario&amp;DeviceID=186hkjw6gjw76463uh2g5gi2j3h&amp;Bla=bla" href="http://www.muscetta.org/Admin">http://www.company.com/exchange?User=Mario&amp;DeviceID=186hkjw6gjw76463uh2g5gi2j3h&amp;Bla=bla</a> (and on an unrelated note: yes, if you try to crawl this link, you are a bot :-))</p>
<p>So we exported ISA logs (there are several tools for this, including &#034;<a href="http://www.isatools.org/tools/ISA_Extract_Logs_v1.8.zip">Extract logs</a>&#034;, but we did not use a script, we just used a filter for the correct publishing rule in the &#034;Monitoring - Logging&#034; tag in ISA Server Console and then copied and pasted those log lines) and tried to see if <a href="http://www.microsoft.com/powershell">PowerShell</a> could help tackle the issue.</p>
<p>Here we load our sample log (in a real log you would have much more information - each single line wrapping several console rows; I cut it short to the URL to make it more readable.</p>
<pre style="color: #eeedf0; background-color: #012456"><span style="background-color: #012456; color: #00ff00;">PS&gt;</span> get-content log.txt    

http://www.company.com/exchange?User=Mario&amp;DevideID=186hkjw6gjw76463uh2g5gi2j3h&amp;Bla=bla
http://www.company.com/exchange?User=Gino&amp;DevideID=186hkjw6gjw76463uh2g5gi2j3h&amp;Bla=bla
http://www.company.com/exchange?User=Antonio&amp;DevideID=186hkjw6gjw76463uh2g5gi2j3h&amp;Bla=bla
http://www.company.com/exchange?User=Antonio&amp;DevideID=186hkjw6gjw76463uh2g5gi2j3h&amp;Bla=bla
http://www.company.com/exchange?User=Gino&amp;DevideID=186hkjw6gjw76463uh2g5gi2j3h&amp;Bla=bla
http://www.company.com/exchange?User=Antonio&amp;DevideID=186hkjw6gjw76463uh2g5gi2j3h&amp;Bla=bla
http://www.company.com/exchange?User=Antonio&amp;DevideID=186hkjw6gjw76463uh2g5gi2j3h&amp;Bla=bla
http://www.company.com/exchange?User=Mario&amp;DevideID=186hkjw6gjw76463uh2g5gi2j3h&amp;Bla=bla
http://www.company.com/exchange?User=Mario&amp;DevideID=186hkjw6gjw76463uh2g5gi2j3h&amp;Bla=bla
http://www.company.com/exchange?User=Mario&amp;DevideID=186hkjw6gjw76463uh2g5gi2j3h&amp;Bla=bla
http://www.company.com/exchange?User=Mario&amp;DevideID=186hkjw6gjw76463uh2g5gi2j3h&amp;Bla=bla
http://www.company.com/exchange?User=Antonio&amp;DevideID=186hkjw6gjw76463uh2g5gi2j3h&amp;Bla=bla
http://www.company.com/exchange?User=Antonio&amp;DevideID=186hkjw6gjw76463uh2g5gi2j3h&amp;Bla=bla
http://www.company.com/exchange?User=Mario&amp;DevideID=186hkjw6gjw76463uh2g5gi2j3h&amp;Bla=bla
http://www.company.com/exchange?User=Antonio&amp;DevideID=186hkjw6gjw76463uh2g5gi2j3h&amp;Bla=bla
http://www.company.com/exchange?User=Antonio&amp;DevideID=186hkjw6gjw76463uh2g5gi2j3h&amp;Bla=bla
http://www.company.com/exchange?User=Mario&amp;DevideID=186hkjw6gjw76463uh2g5gi2j3h&amp;Bla=bla
http://www.company.com/exchange?User=Antonio&amp;DevideID=186hkjw6gjw76463uh2g5gi2j3h&amp;Bla=bla
http://www.company.com/exchange?User=Antonio&amp;DevideID=186hkjw6gjw76463uh2g5gi2j3h&amp;Bla=bla
http://www.company.com/exchange?User=Mario&amp;DevideID=186hkjw6gjw76463uh2g5gi2j3h&amp;Bla=bla
http://www.company.com/exchange?User=Antonio&amp;DevideID=186hkjw6gjw76463uh2g5gi2j3h&amp;Bla=bla
http://www.company.com/exchange?User=Antonio&amp;DevideID=186hkjw6gjw76463uh2g5gi2j3h&amp;Bla=bla
http://www.company.com/exchange?User=Mario&amp;DevideID=186hkjw6gjw76463uh2g5gi2j3h&amp;Bla=bla</pre>
<p>We know Get-Content does not just display the file, it loads the file into a string array.</p>
<p>So we can cycle through the file and try to extract (using a regexp) the string after &#034;User=&#034; and before the first ampersand (&#034;&amp;&#034;), which translates in the following regular expression:</p>
<p><strong>&#034;User=(?&lt;nome&gt;.*?)&amp;&#034;</strong></p>
<p>(the regexp has been the most difficult thing to figure out, but it is very worth the hassle once you&#039;ve done it&#8230;)</p>
<pre style="color: #eeedf0; background-color: #012456"><span style="background-color: #012456; color: #00ff00;">PS&gt;</span> get-content log.txt | foreach {$_ -match "User=(?<span>&lt;</span>nome&gt;.*?)&amp;" | out-null; $matches}
Name                           Value
----                           -----
nome                           Mario
0                              User=Mario&amp; nome                           Gino
0                              User=Gino&amp;
nome                           Antonio
0                              User=Antonio&amp;
nome                           Antonio
0                              User=Antonio&amp;
nome                           Gino
0                              User=Gino&amp;
nome                           Antonio
0                              User=Antonio&amp;
nome                           Antonio
0                              User=Antonio&amp;
nome                           Mario
0                              User=Mario&amp;
nome                           Mario
0                              User=Mario&amp;
nome                           Mario
0                              User=Mario&amp;
nome                           Mario
0                              User=Mario&amp;
nome                           Antonio
0                              User=Antonio&amp;
nome                           Antonio
0                              User=Antonio&amp;
nome                           Mario
0                              User=Mario&amp;
nome                           Antonio
0                              User=Antonio&amp;
nome                           Antonio
0                              User=Antonio&amp;
nome                           Mario
0                              User=Mario&amp;
nome                           Antonio
0                              User=Antonio&amp;
nome                           Antonio
0                              User=Antonio&amp;
nome                           Mario
0                              User=Mario&amp;
nome                           Antonio
0                              User=Antonio&amp;
nome                           Antonio
0                              User=Antonio&amp;
nome                           Mario
0                              User=Mario&amp;
nome                           Mario
0                              User=Mario&amp;</pre>
<p>This seems to work. Now we only have to get the Named Captures called &#034;nome&#034; (containing the user name):</p>
<pre style="color: #eeedf0; background-color: #012456"><span style="background-color: #012456; color: #00ff00;">PS&gt;</span> <strong>get-content log.txt | foreach {$_ -match "User=(?<span>&lt;</span>name&gt;.*?)&amp;" | out-null; $matches["name"]}
</strong>Mario
Gino
Antonio Antonio
Gino
Antonio
Antonio
Mario
Mario
Mario
Mario
Antonio
Antonio
Mario
Antonio
Antonio
Mario
Antonio
Antonio
Mario
Antonio
Antonio
Mario
Mario</pre>
<p>Awesome. Now sort them and remove duplicates. Which is one more command in our pipeline:</p>
<p><strong>get-content log.txt | foreach {$_ -match &#034;User=(?&lt;nome&gt;.*?)&amp;&#034; | out-null; $matches["nome"]} | sort-object -uniq</strong></p>
<pre style="color: #eeedf0; background-color: #012456"><span style="background-color: #012456; color: #00ff00;">P&gt;</span> get-content log.txt | foreach {$_ -match "User=(?<span>&lt;</span>name&gt;.*?)&amp;" | out-null; $matches["name"]} | sort-object -uniq
Antonio
Gino
Mario     

<span style="background-color: #012456; color: #00ff00;">PS&gt;</span>
<span style="background-color: #012456; color: #00ff00;">PS&gt;</span></pre>
<p>Now you can call those three users and tell them to modify their ActiveSync configuration <img src='http://www.muscetta.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.muscetta.com/2007/08/09/powershell-and-regexp-a-match-made-my-day/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Death by right-click -&gt; Delete ? Nope. PowerShell.</title>
		<link>http://www.muscetta.com/2007/05/30/death-by-right-click-delete-nope-powershell/</link>
		<comments>http://www.muscetta.com/2007/05/30/death-by-right-click-delete-nope-powershell/#comments</comments>
		<pubDate>Wed, 30 May 2007 09:55:42 +0000</pubDate>
		<dc:creator>Daniele Muscetta</dc:creator>
		
		<category><![CDATA[Coding]]></category>

		<category><![CDATA[Interop]]></category>

		<category><![CDATA[Microsoft]]></category>

		<category><![CDATA[PowerShell]]></category>

		<category><![CDATA[RSS]]></category>

		<category><![CDATA[Tools]]></category>

		<category><![CDATA[dotNet]]></category>

		<guid isPermaLink="false">http://www.muscetta.com/2007/05/30/death-by-right-click-delete-nope-powershell/</guid>
		<description><![CDATA[So at one stage I was testing the RSS reader capabilities of Outlook 2007, and I imported an OPML file with roughly 500 feeds! Of course I was NOT interested in reading ALL of them, and it was causing quite a bit of work to do on my machine to fetch them all and sync [...]]]></description>
			<content:encoded><![CDATA[<p>So at one stage I was testing the RSS reader capabilities of Outlook 2007, and I imported an OPML file with roughly 500 feeds! Of course I was NOT interested in reading ALL of them, and it was causing quite a bit of work to do on my machine to fetch them all and sync the content in my mailbox&#8230;</p>
<p>So I figured out it was possible to remove the subscription (from the Tools menu -&gt; Account Settings -&gt; RSS Feeds) but the folders were left there. Now, I didn&#039;t want to have those 500 folders in my mailbox, and I did not even want to die by right-clicking, pressing &#034;delete&#034;, confirming&#8230;. all of this 500 times! No way.</p>
<p>So I wrote this little PowerShell script, I guess it *might* be helpful to someone at one stage, who knows ?</p>
<p>[System.Reflection.Assembly]::LoadWithPartialName(&#039;Microsoft.Office.Interop.Outlook&#039;)<br />
$oApp = New-Object -COM &#039;Outlook.Application&#039;<br />
$rss = $oApp.GetNamespace(&#034;MAPI&#034;).GetDefaultFolder(&#034;olFolderRssFeeds&#034;)<br />
forach ($folder in $rss.Folders)<br />
{<br />
$folder.Delete()<br />
}</p>
<p>Please note that if you don&#039;t have the Office Interop Assemblies installed on your machine, you can&#039;t use the first line. As a result, you will have to change the third line hardcoding the number that represents the RSSFeeds folder, so it would become:</p>
<p>$rss = $oApp.GetNamespace(&#034;MAPI&#034;).GetDefaultFolder(25)</p>
<p>Note: I found out (later, of course) that there is a much more general post on this subject (that is, automating Outlook through PowerShell): <a href="http://www.leeholmes.com/blog/GettingThingsDoneOutlookTaskAutomationWithPowerShell.aspx">http://www.leeholmes.com/blog/GettingThingsDoneOutlookTaskAutomationWithPowerShell.aspx</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.muscetta.com/2007/05/30/death-by-right-click-delete-nope-powershell/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Out-Flickr!!</title>
		<link>http://www.muscetta.com/2007/01/10/out-flickr/</link>
		<comments>http://www.muscetta.com/2007/01/10/out-flickr/#comments</comments>
		<pubDate>Wed, 10 Jan 2007 15:02:28 +0000</pubDate>
		<dc:creator>Daniele Muscetta</dc:creator>
		
		<category><![CDATA[Blogs]]></category>

		<category><![CDATA[Coding]]></category>

		<category><![CDATA[Cross Platform]]></category>

		<category><![CDATA[Cross Post]]></category>

		<category><![CDATA[Flickr]]></category>

		<category><![CDATA[ITVC]]></category>

		<category><![CDATA[Integration]]></category>

		<category><![CDATA[Interop]]></category>

		<category><![CDATA[Live]]></category>

		<category><![CDATA[Microsoft]]></category>

		<category><![CDATA[PowerShell]]></category>

		<category><![CDATA[Tools]]></category>

		<category><![CDATA[WebSite]]></category>

		<category><![CDATA[dotNet]]></category>

		<guid isPermaLink="false">http://www.muscetta.com/2007/01/10/out-flickr/</guid>
		<description><![CDATA[This is soooo cool! An &#034;Out-Flickr&#034; script for PowerShell:
http://abhishek225.spaces.live.com/blog/cns!13469C7B7CE6E911!285.entry
]]></description>
			<content:encoded><![CDATA[<p>This is soooo cool! An &#034;Out-Flickr&#034; script for PowerShell:</p>
<p><a href="http://abhishek225.spaces.live.com/blog/cns!13469C7B7CE6E911!285.entry">http://abhishek225.spaces.live.com/blog/cns!13469C7B7CE6E911!285.entry</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.muscetta.com/2007/01/10/out-flickr/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Out-Blog!</title>
		<link>http://www.muscetta.com/2006/11/24/out-blog/</link>
		<comments>http://www.muscetta.com/2006/11/24/out-blog/#comments</comments>
		<pubDate>Fri, 24 Nov 2006 11:21:19 +0000</pubDate>
		<dc:creator>Daniele Muscetta</dc:creator>
		
		<category><![CDATA[Blogs]]></category>

		<category><![CDATA[C#]]></category>

		<category><![CDATA[Choice]]></category>

		<category><![CDATA[Coding]]></category>

		<category><![CDATA[Cross Post]]></category>

		<category><![CDATA[ITVC]]></category>

		<category><![CDATA[Integration]]></category>

		<category><![CDATA[Interop]]></category>

		<category><![CDATA[Microsoft]]></category>

		<category><![CDATA[Networking]]></category>

		<category><![CDATA[Personal]]></category>

		<category><![CDATA[PowerShell]]></category>

		<category><![CDATA[Rant]]></category>

		<category><![CDATA[Tools]]></category>

		<category><![CDATA[WebSite]]></category>

		<category><![CDATA[dotNet]]></category>

		<guid isPermaLink="false">http://www.muscetta.com/2006/11/24/out-blog/</guid>
		<description><![CDATA[[Edited again 25th November -&#160;Jachym gave me some suggestions and insights on the use of parameters, and I slightly changed/fixed the original code I had posted yesterday. There&#160;are still some more things that could be improved, of course, but I'll leave them to the future, next time I'll have time fot it (who knows when [...]]]></description>
			<content:encoded><![CDATA[<p><span style="color: black">[Edited again 25th November -&nbsp;<a href="http://blog.vyvojar.cz/jachymko/">Jachym</a> gave me some suggestions and insights on the use of parameters, and I slightly changed/fixed the original code I had posted yesterday. There&nbsp;are still some more things that could be improved, of course, but I'll leave them to the future, next time I'll have time fot it (who knows when that will be?)]</span></p>
<p><span style="color: black">This one is a post regarding my first test writing a cmdlet for PowerShell. After a few days since having change my blog&#039;s title to <strong><em>&#034;$daniele.rant | Out-Blog&#034;</em></strong> (where Out-Blog was a fantasy cmdlet name, and the title just meant to mimick PowerShell syntax in a funny way), I stumbled across this wonderful blog post: </span><span style="color: #669966; text-decoration: underline"><a href="http://blog.boschin.it/archive/2006/09/21/4375.aspx">http://blog.boschin.it/archive/2006/09/21/4375.aspx</a></span>&nbsp;<span style="color: black">that describes how to use the assemblies of &#034;Windows Live Writer&#034;. Then I saw the light: I could actually implement an &#034;Out-Blog&#034; cmdlet. I am not sure what this could be useful for&#8230; but I thought it was funny to experiment with. I followed the HOW TO information on this other blog post to guide me through the coding: </span><span style="color: #669966; text-decoration: underline"><a href="http://www.proudlyserving.com/archives/2005/10/lets_all_write_1.html">http://www.proudlyserving.com/archives/2005/10/lets_all_write_1.html</a></span></p>
<p><span style="color: #669966; text-decoration: underline"></span><span style="font-size: 10pt">The result is the&nbsp;</span><span style="font-size: 10pt; color: black">code that follows. you see is pretty much Boschin&#039;s code wrapped into a cmdlet class. Nothing fancy. Just a&nbsp;test. I thought someone might find it interesting. It is provided &#034;AS IS&#034;, mainly for educational purpose (MINE, only&nbsp;mine&#8230;. I&#039;m the one whose education is being improved, not you :-))</span></p>
<p><span style="font-size: 10pt; font-family: trebuchet ms"></span></p>
<p><img src="http://static.flickr.com/119/304859662_fa52bac956.jpg"/>&nbsp;</p>
<p>&nbsp;</p>
</p>
<p><span style="font-size: 10pt; font-family: courier new"></span><span style="color: blue">using</span> System; </p>
<p><span style="color: blue">using</span> System.Collections.Generic; </p>
<p><span style="font-size: 10pt; font-family: courier new"></span><span style="color: blue">using</span> System.Text; </p>
<p><span style="font-size: 10pt; font-family: courier new"></span><span style="color: blue">using</span> System.Management.Automation; </p>
<p><span style="font-size: 10pt; font-family: courier new"></span><span style="color: blue">using</span> WindowsLive.Writer.BlogClient.Clients; </p>
<p><span style="font-size: 10pt; font-family: courier new"></span><span style="color: blue">using</span> WindowsLive.Writer.BlogClient; </p>
<p><span style="font-size: 10pt; font-family: courier new"></span><span style="color: blue">using</span> WindowsLive.Writer.CoreServices; </p>
<p><span style="font-size: 10pt; font-family: courier new"></span><span style="color: blue">using</span> WindowsLive.Writer.CoreServices.Settings; </p>
<p><span style="font-size: 10pt; font-family: courier new"></span><span style="color: blue">using</span> WindowsLive.Writer.Extensibility.BlogClient; </p>
<p><span style="font-size: 10pt; font-family: courier new"></span><span style="color: blue">using</span> Microsoft.Win32; </p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><span style="font-size: 10pt; font-family: courier new"></span><span style="color: blue">namespace</span> LiveWriterCmdlet </p>
<p><span style="font-size: 10pt; font-family: courier new">{ </span></p>
<p><span style="font-size: 10pt; font-family: courier new">[</span><span style="color: teal">Cmdlet</span>(<span style="color: maroon">"out"</span>, <span style="color: maroon">"blog"</span>, SupportsShouldProcess=<span style="color: blue">true</span>)] </p>
<p>&nbsp;</p>
<p><span style="font-size: 10pt; font-family: courier new"></span><span style="color: blue">public</span> <span style="color: blue">sealed</span> <span style="color: blue">class</span> <span style="color: teal">OutBlogCmdlet</span> : <span style="color: teal">Cmdlet </span></p>
<p><span style="font-size: 10pt; font-family: courier new">{ </span></p>
<p><span style="font-size: 10pt; font-family: courier new">[</span><span style="color: teal">Parameter</span>(Position = 0, Mandatory = <span style="color: blue">true</span>, ValueFromPipeline = <span style="color: blue">false</span>, ValueFromPipelineByPropertyName = <span style="color: blue">true</span>)] </p>
<p><span style="font-size: 10pt; font-family: courier new">[</span><span style="color: teal">ValidateNotNullOrEmpty</span>] </p>
<p><span style="font-size: 10pt; font-family: courier new"></span><span style="color: blue">public</span> <span style="color: blue">string</span> Title </p>
<p><span style="font-size: 10pt; font-family: courier new">{ </span></p>
<p><span style="font-size: 10pt; font-family: courier new"></span><span style="color: blue">get</span> { <span style="color: blue">return</span> _title; } </p>
<p><span style="font-size: 10pt; font-family: courier new"></span><span style="color: blue">set</span> { _title = <span style="color: blue">value</span>; } </p>
<p><span style="font-size: 10pt; font-family: courier new">} </span></p>
<p><span style="font-size: 10pt; font-family: courier new"></span><span style="color: blue">private</span> <span style="color: blue">string</span> _title; </p>
<p>&nbsp;</p>
<p><span style="font-size: 10pt; font-family: courier new">[</span><span style="color: teal">Parameter</span>(Position=1,Mandatory=<span style="color: blue">true</span>,ValueFromPipeline=<span style="color: blue">true</span>,ValueFromPipelineByPropertyName=<span style="color: blue">true</span>)] </p>
<p><span style="font-size: 10pt; font-family: courier new">[</span><span style="color: teal">ValidateNotNullOrEmpty</span>] </p>
<p><span style="font-size: 10pt; font-family: courier new"></span><span style="color: blue">public</span> <span style="color: blue">string</span> Text </p>
<p><span style="font-size: 10pt; font-family: courier new">{ </span></p>
<p><span style="font-size: 10pt; font-family: courier new"></span><span style="color: blue">get</span> { <span style="color: blue">return</span> _text; } </p>
<p><span style="font-size: 10pt; font-family: courier new"></span><span style="color: blue">set</span> { _text = <span style="color: blue">value</span>; } </p>
<p><span style="font-size: 10pt; font-family: courier new">} </span></p>
<p><span style="font-size: 10pt; font-family: courier new"></span><span style="color: blue">private</span> <span style="color: blue">string</span> _text; </p>
<p>&nbsp;</p>
<p><span style="font-size: 10pt; font-family: courier new">[</span><span style="color: teal">Parameter</span>(Position = 2, Mandatory = <span style="color: blue">true</span>, ValueFromPipeline = <span style="color: blue">false</span>, ValueFromPipelineByPropertyName = <span style="color: blue">true</span>)] </p>
<p><span style="font-size: 10pt; font-family: courier new">[</span><span style="color: teal">ValidateNotNullOrEmpty</span>] </p>
<p><span style="font-size: 10pt; font-family: courier new"></span><span style="color: blue">public</span> <span style="color: blue">string</span> BlogApiEndPoint </p>
<p><span style="font-size: 10pt; font-family: courier new">{ </span></p>
<p><span style="font-size: 10pt; font-family: courier new"></span><span style="color: blue">get</span> { <span style="color: blue">return</span> _blogapiendpoint; } </p>
<p><span style="font-size: 10pt; font-family: courier new"></span><span style="color: blue">set</span> { _blogapiendpoint = <span style="color: blue">value</span>; } </p>
<p><span style="font-size: 10pt; font-family: courier new">} </span></p>
<p><span style="font-size: 10pt; font-family: courier new"></span><span style="color: blue">private</span> <span style="color: blue">string</span> _blogapiendpoint; </p>
<p>&nbsp;</p>
<p><span style="font-size: 10pt; font-family: courier new">[</span><span style="color: teal">Parameter</span>(Position = 3, Mandatory = <span style="color: blue">true</span>, ValueFromPipeline = <span style="color: blue">false</span>, ValueFromPipelineByPropertyName = <span style="color: blue">true</span>)] </p>
<p><span style="font-size: 10pt; font-family: courier new">[</span><span style="color: teal">ValidateNotNullOrEmpty</span>] </p>
<p><span style="font-size: 10pt; font-family: courier new"></span><span style="color: blue">public</span> <span style="color: blue">string</span> UserName </p>
<p><span style="font-size: 10pt; font-family: courier new">{ </span></p>
<p><span style="font-size: 10pt; font-family: courier new"></span><span style="color: blue">get</span> { <span style="color: blue">return</span> _username; } </p>
<p><span style="font-size: 10pt; font-family: courier new"></span><span style="color: blue">set</span> { _username = <span style="color: blue">value</span>; } </p>
<p><span style="font-size: 10pt; font-family: courier new">} </span></p>
<p><span style="font-size: 10pt; font-family: courier new"></span><span style="color: blue">private</span> <span style="color: blue">string</span> _username; </p>
<p>&nbsp;</p>
<p><span style="font-size: 10pt; font-family: courier new">[</span><span style="color: teal">Parameter</span>(Position = 4, Mandatory = <span style="color: blue">true</span>, ValueFromPipeline = <span style="color: blue">false</span>, ValueFromPipelineByPropertyName = <span style="color: blue">true</span>)] </p>
<p><span style="font-size: 10pt; font-family: courier new">[</span><span style="color: teal">ValidateNotNullOrEmpty</span>] </p>
<p><span style="font-size: 10pt; font-family: courier new"></span><span style="color: blue">public</span> <span style="color: blue">string</span> Password </p>
<p><span style="font-size: 10pt; font-family: courier new">{ </span></p>
<p><span style="font-size: 10pt; font-family: courier new"></span><span style="color: blue">get</span> { <span style="color: blue">return</span> _password; } </p>
<p><span style="font-size: 10pt; font-family: courier new"></span><span style="color: blue">set</span> { _password = <span style="color: blue">value</span>; } </p>
<p><span style="font-size: 10pt; font-family: courier new">} </span></p>
<p><span style="font-size: 10pt; font-family: courier new"></span><span style="color: blue">private</span> <span style="color: blue">string</span> _password; </p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><span style="font-size: 10pt; font-family: courier new">[</span><span style="color: teal">Parameter</span>(Position = 6, Mandatory = <span style="color: blue">false</span>, ValueFromPipeline = <span style="color: blue">false</span>, ValueFromPipelineByPropertyName = <span style="color: blue">true</span>)] </p>
<p><span style="font-size: 10pt; font-family: courier new">[</span><span style="color: teal">ValidateNotNullOrEmpty</span>] </p>
<p><span style="font-size: 10pt; font-family: courier new"></span><span style="color: blue">public</span> <span style="color: blue">string</span> ProxyAddress </p>
<p><span style="font-size: 10pt; font-family: courier new">{ </span></p>
<p><span style="font-size: 10pt; font-family: courier new"></span><span style="color: blue">get</span> { <span style="color: blue">return</span> _proxyaddress; } </p>
<p><span style="font-size: 10pt; font-family: courier new"></span><span style="color: blue">set</span> { _proxyaddress = <span style="color: blue">value</span>; } </p>
<p><span style="font-size: 10pt; font-family: courier new">} </span></p>
<p><span style="font-size: 10pt; font-family: courier new"></span><span style="color: blue">private</span> <span style="color: blue">string</span> _proxyaddress; </p>
<p>&nbsp;</p>
<p><span style="font-size: 10pt; font-family: courier new">[</span><span style="color: teal">Parameter</span>(Position = 7, Mandatory = <span style="color: blue">false</span>, ValueFromPipeline = <span style="color: blue">false</span>, ValueFromPipelineByPropertyName = <span style="color: blue">true</span>)] </p>
<p><span style="font-size: 10pt; font-family: courier new">[</span><span style="color: teal">ValidateNotNullOrEmpty</span>] </p>
<p><span style="font-size: 10pt; font-family: courier new"></span><span style="color: blue">public</span> <span style="color: blue">int</span> ProxyPort </p>
<p><span style="font-size: 10pt; font-family: courier new">{ </span></p>
<p><span style="font-size: 10pt; font-family: courier new"></span><span style="color: blue">get</span> { <span style="color: blue">return</span> _proxyport; } </p>
<p><span style="font-size: 10pt; font-family: courier new"></span><span style="color: blue">set</span> { _proxyport = <span style="color: blue">value</span>; } </p>
<p><span style="font-size: 10pt; font-family: courier new">} </span></p>
<p><span style="font-size: 10pt; font-family: courier new"></span><span style="color: blue">private</span> <span style="color: blue">int</span> _proxyport; </p>
<p>&nbsp;</p>
<p><span style="font-size: 10pt; font-family: courier new">[</span><span style="color: teal">Parameter</span>(Position = 8, Mandatory = <span style="color: blue">false</span>, ValueFromPipeline = <span style="color: blue">false</span>, ValueFromPipelineByPropertyName = <span style="color: blue">true</span>)] </p>
<p><span style="font-size: 10pt; font-family: courier new"></span><span style="color: blue">public</span> <span style="color: blue">string</span> ProxyUserName </p>
<p><span style="font-size: 10pt; font-family: courier new">{ </span></p>
<p><span style="font-size: 10pt; font-family: courier new"></span><span style="color: blue">get</span> { <span style="color: blue">return</span> _proxyusername; } </p>
<p><span style="font-size: 10pt; font-family: courier new"></span><span style="color: blue">set</span> { _proxyusername = <span style="color: blue">value</span>; } </p>
<p><span style="font-size: 10pt; font-family: courier new">} </span></p>
<p><span style="font-size: 10pt; font-family: courier new"></span><span style="color: blue">private</span> <span style="color: blue">string</span> _proxyusername; </p>
<p>&nbsp;</p>
<p><span style="font-size: 10pt; font-family: courier new">[</span><span style="color: teal">Parameter</span>(Position = 9, Mandatory = <span style="color: blue">false</span>, ValueFromPipeline = <span style="color: blue">false</span>, ValueFromPipelineByPropertyName = <span style="color: blue">true</span>)] </p>
<p><span style="font-size: 10pt; font-family: courier new"></span><span style="color: blue">public</span> <span style="color: blue">string</span> ProxyPassword </p>
<p><span style="font-size: 10pt; font-family: courier new">{ </span></p>
<p><span style="font-size: 10pt; font-family: courier new"></span><span style="color: blue">get</span> { <span style="color: blue">return</span> _proxypassword; } </p>
<p><span style="font-size: 10pt; font-family: courier new"></span><span style="color: blue">set</span> { _proxypassword = <span style="color: blue">value</span>; } </p>
<p><span style="font-size: 10pt; font-family: courier new">} </span></p>
<p><span style="font-size: 10pt; font-family: courier new"></span><span style="color: blue">private</span> <span style="color: blue">string</span> _proxypassword; </p>
<p>&nbsp;</p>
<p><span style="font-size: 10pt; font-family: courier new">[</span><span style="color: teal">Parameter</span>(Position = 10, Mandatory = <span style="color: blue">false</span>, ValueFromPipeline = <span style="color: blue">false</span>, ValueFromPipelineByPropertyName = <span style="color: blue">true</span>)] </p>
<p><span style="font-size: 10pt; font-family: courier new"></span><span style="color: blue">public</span> <span style="color: teal">SwitchParameter</span> Published </p>
<p><span style="font-size: 10pt; font-family: courier new">{ </span></p>
<p><span style="font-size: 10pt; font-family: courier new"></span><span style="color: blue">get</span> { <span style="color: blue">return</span> _published; } </p>
<p><span style="font-size: 10pt; font-family: courier new"></span><span style="color: blue">set</span> { _published = <span style="color: blue">value</span>; } </p>
<p><span style="font-size: 10pt; font-family: courier new">} </span></p>
<p><span style="font-size: 10pt; font-family: courier new"></span><span style="color: blue">private</span> <span style="color: blue">bool</span> _published; </p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><span style="font-size: 10pt; font-family: courier new"></span><span style="color: blue">protected</span> <span style="color: blue">override</span> <span style="color: blue">void</span> BeginProcessing() </p>
<p><span style="font-size: 10pt; font-family: courier new">{ </span></p>
<p><span style="font-size: 10pt; font-family: courier new"></span><span style="color: blue">base</span>.BeginProcessing(); </p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><span style="font-size: 10pt; font-family: courier new"></span><span style="color: teal">ApplicationEnvironment</span>.Initialize(); </p>
<p><span style="font-size: 10pt; font-family: courier new"></span><span style="color: blue">if</span> ((ProxyAddress != <span style="color: blue">null</span>) | (ProxyAddress != <span style="color: maroon">&#034;&#034;</span>)) </p>
<p><span style="font-size: 10pt; font-family: courier new">{ </span></p>
<p><span style="font-size: 10pt; font-family: courier new"></span><span style="color: teal">WebProxySettings</span>.ProxyEnabled = <span style="color: blue">true</span>; </p>
<p><span style="font-size: 10pt; font-family: courier new"></span><span style="color: teal">WebProxySettings</span>.Hostname = ProxyAddress; </p>
<p><span style="font-size: 10pt; font-family: courier new"></span><span style="color: teal">WebProxySettings</span>.Port = ProxyPort; </p>
<p><span style="font-size: 10pt; font-family: courier new"></span><span style="color: teal">WebProxySettings</span>.Username = ProxyUserName; </p>
<p><span style="font-size: 10pt; font-family: courier new"></span><span style="color: teal">WebProxySettings</span>.Password = ProxyPassword; </p>
<p>&nbsp;</p>
<p><span style="font-size: 10pt; font-family: courier new">} </span></p>
<p><span style="font-size: 10pt; font-family: courier new"></span><span style="color: blue">else</span> </p>
<p><span style="font-size: 10pt; font-family: courier new">{ </span></p>
<p><span style="font-size: 10pt; font-family: courier new"></span><span style="color: teal">WebProxySettings</span>.ProxyEnabled = <span style="color: blue">false</span>; </p>
<p><span style="font-size: 10pt; font-family: courier new">} </span></p>
<p>&nbsp;</p>
<p><span style="font-size: 10pt; font-family: courier new">} </span></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><span style="font-size: 10pt; font-family: courier new"></span><span style="color: blue">protected</span> <span style="color: blue">override</span> <span style="color: blue">void</span> ProcessRecord() </p>
<p><span style="font-size: 10pt; font-family: courier new">{ </span></p>
<p><span style="font-size: 10pt; font-family: courier new"></span><span style="color: blue">if</span> (ShouldProcess(Text)) </p>
<p><span style="font-size: 10pt; font-family: courier new">{ </span></p>
<p><span style="font-size: 10pt; font-family: courier new"></span><span style="color: teal">ISettingsPersister</span> persister = <span style="color: blue">new</span> <span style="color: teal">RegistrySettingsPersister</span>(<span style="color: teal">Registry</span>.CurrentUser, <span style="color: maroon">@&#034;Software\Windows Live Writer&#034;</span>); </p>
<p><span style="font-size: 10pt; font-family: courier new"></span><span style="color: teal">IBlogCredentials</span> credentials = <span style="color: blue">new</span> <span style="color: teal">BlogCredentials</span>(<span style="color: blue">new</span> <span style="color: teal">SettingsPersisterHelper</span>(persister)); </p>
<p><span style="font-size: 10pt; font-family: courier new"></span><span style="color: teal">IBlogCredentialsAccessor</span> credentialsAccessor = <span style="color: blue">new</span> <span style="color: teal">BlogCredentialsAccessor</span>(<span style="color: maroon">&#034;dummy-value&#034;</span>, credentials); </p>
<p>&nbsp;</p>
<p><span style="font-size: 10pt; font-family: courier new">credentials.Username = UserName; </span></p>
<p><span style="font-size: 10pt; font-family: courier new">credentials.Password = Password; </span></p>
<p>&nbsp;</p>
<p><span style="font-size: 10pt; font-family: courier new"></span><span style="color: teal">MovableTypeClient</span> client = <span style="color: blue">new</span> <span style="color: teal">MovableTypeClient</span>(<span style="color: blue">new</span> <span style="color: teal">Uri</span>(BlogApiEndPoint), credentialsAccessor, <span style="color: teal">PostFormatOptions</span>.Unknown); </p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><span style="font-size: 10pt; font-family: courier new"></span><span style="color: teal">BlogPost</span> MyPost = <span style="color: blue">new</span> <span style="color: teal">BlogPost</span>(); </p>
<p><span style="font-size: 10pt; font-family: courier new">MyPost.Title = Title; </span></p>
<p><span style="font-size: 10pt; font-family: courier new">MyPost.Contents = Text; </span></p>
<p><span style="font-size: 10pt; font-family: courier new">client.NewPost(</span><span style="color: maroon">&#034;dummy-value&#034;</span>, MyPost, Published); </p>
<p>&nbsp;</p>
<p><span style="font-size: 10pt; font-family: courier new">WriteVerbose(</span><span style="color: maroon">&#034;Posted Successfully.&#034;</span>); </p>
<p>&nbsp;</p>
<p><span style="font-size: 10pt; font-family: courier new">} </span></p>
<p>&nbsp;</p>
<p><span style="font-size: 10pt; font-family: courier new">} </span></p>
<p>&nbsp;</p>
<p><span style="font-size: 10pt; font-family: courier new">} </span></p>
<p><span style="font-size: 10pt; font-family: courier new">} </span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.muscetta.com/2006/11/24/out-blog/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
