<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Adam.Kahtava.com / AdamDotCom &#187; PowerShell</title>
	<atom:link href="http://adam.kahtava.com/journal/category/powershell/feed/" rel="self" type="application/rss+xml" />
	<link>http://adam.kahtava.com/journal</link>
	<description>A software development blog</description>
	<lastBuildDate>Thu, 02 Feb 2012 21:35:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Install Git On Windows With PowerShell</title>
		<link>http://adam.kahtava.com/journal/2010/05/04/install-git-on-windows-with-powershell/</link>
		<comments>http://adam.kahtava.com/journal/2010/05/04/install-git-on-windows-with-powershell/#comments</comments>
		<pubDate>Tue, 04 May 2010 17:00:50 +0000</pubDate>
		<dc:creator>Adam Kahtava</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[PowerShell]]></category>

		<guid isPermaLink="false">http://adam.kahtava.com/journal/?p=2566</guid>
		<description><![CDATA[I like Git and here's a PowerShell script that I use to download and install Git on my Windows based development machines. PLAIN TEXT POWERSHELL: # Installs git for Windows via PowerShell # # Sample usage: # #&#160; Install git: #&#160; &#160; PS&#62; install-git # # Adam Kahtava - http://adam.kahtava.com/ - MIT Licensed &#160; function [...]]]></description>
			<content:encoded><![CDATA[<p>I like <a href="http://en.wikipedia.org/wiki/Git_(software)">Git</a> and here's a PowerShell script that I use to download and install Git on my Windows based development machines.</p>
<div class="igBar"><span id="lpowershell-2"><a href="#" onclick="javascript:showPlainTxt('powershell-2'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">POWERSHELL:</span>
<div id="powershell-2">
<div class="powershell">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #004400; font-style: italic;"># Installs git for Windows via PowerShell</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #004400; font-style: italic;">#</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #004400; font-style: italic;"># Sample usage:</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #004400; font-style: italic;">#</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #004400; font-style: italic;">#&nbsp; Install git:</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #004400; font-style: italic;">#&nbsp; &nbsp; PS&gt; install-git</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #004400; font-style: italic;">#</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #004400; font-style: italic;"># Adam Kahtava - http://adam.kahtava.com/ - MIT Licensed</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">function</span> global:install-git <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; install-file <span style="color: #3366CC;">'http://msysgit.googlecode.com/files/Git-1.6.4-preview20090730.exe'</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">function</span> global:install-file<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#91;</span>string<span style="color: #66cc66;">&#93;</span> $urlPath<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; $filename = download-file<span style="color: #66cc66;">&#40;</span>$urlPath<span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #000066;">invoke-item</span> $filename</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">function</span> global:download-file<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#91;</span>string<span style="color: #66cc66;">&#93;</span> $urlPath<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; $urlSplit = $urlPath.<span style="color: #006600;">split</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'/'</span><span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; $filename = <span style="color: #66cc66;">&#40;</span><span style="color: #000066;">Resolve-Path</span> .<span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">ToString</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> + <span style="color: #3366CC;">''</span> + $urlSplit<span style="color: #66cc66;">&#91;</span>$urlSplit.<span style="color: #006600;">length</span> - <span style="color: #CC0000;color:#800000;">1</span><span style="color: #66cc66;">&#93;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; $webclient = <span style="color: #000066;">New-Object</span> <span style="color: #3366CC;">"System.Net.WebClient"</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; $webclient.<span style="color: #006600;">DownloadFile</span><span style="color: #66cc66;">&#40;</span>$urlPath, $filename<span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #000066; font-weight: bold;">return</span> $filename</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Not familiar with Git? Then head over to <a href="http://learn.github.com/">the best online Git resource available</a>. </p>
<p>You can find more of my PowerShell development scripts <a href="http://code.google.com/p/adamdotcom-script/source/browse/trunk/Scripts/PowerShell/Development-Utilities.ps1">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://adam.kahtava.com/journal/2010/05/04/install-git-on-windows-with-powershell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Memcached On PowerShell</title>
		<link>http://adam.kahtava.com/journal/2010/03/09/memcached-on-powershell/</link>
		<comments>http://adam.kahtava.com/journal/2010/03/09/memcached-on-powershell/#comments</comments>
		<pubDate>Tue, 09 Mar 2010 17:00:44 +0000</pubDate>
		<dc:creator>Adam Kahtava</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://adam.kahtava.com/journal/?p=2383</guid>
		<description><![CDATA[Memcached has been around for a while, but it's still pretty neat. Experiencing a bottleneck with your Object Relational Mappers, Services, Middleware, Database, or whatever? Then Memcached it! Memcached was intially developed for LiveJournal by Danga Interactive in 2003, and is used by many large sites (YouTube, Amazon, Twitter, to name a few). Today, you [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://memcached.org/">Memcached</a> has been around for a while, but it's still pretty neat. </p>
<p><em>Experiencing a bottleneck with your Object Relational Mappers, Services, Middleware, Database, or whatever? Then Memcached it!</em></p>
<p>Memcached was intially developed for LiveJournal by Danga Interactive in 2003, and is used by many large sites (YouTube, Amazon, Twitter, to name a few). Today, you can find a Memcached library for all your favourite languages (<a href="http://code.google.com/p/memcached/wiki/Clients">here's the list</a>).</p>
<p>Now; cache testing is tough period, and testing Memcached (which is accessed through a <a href="http://lzone.de/articles/memcached.htm">telnet</a> client) is even more difficult - it's fair to mention that there are a large number of wrappers for Memcached outside the .NET world, but I couldn't find one for that met my needs. </p>
<h3>Introducing Memcached on Powershell</h3>
<p><strong>Sample usage and output</strong></p>
<p>Loading the script (source can be found <a href="http://github.com/AdamDotCom/memcached-on-powershell/raw/master/memcached-on-powershell.ps1">here</a>)</p>
<div class="igBar"><span id="lcode-8"><a href="#" onclick="javascript:showPlainTxt('code-8'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-8">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">PS C:\&gt; .\memcached-on-powershell.<span style="">ps1</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Checking Memcached stats on an empty instance</p>
<div class="igBar"><span id="lcode-9"><a href="#" onclick="javascript:showPlainTxt('code-9'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-9">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">PS C:\&gt; memcached-stats <span style="color:#800000;color:#800000;">127</span>.<span style="color:#800000;color:#800000;">0</span>.<span style="color:#800000;color:#800000;">0</span>.<span style="color:#800000;color:#800000;">1</span> <span style="color:#800000;color:#800000;">11211</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Total items in cache:&nbsp; <span style="color:#800000;color:#800000;">0</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">No slabs found </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Checking Memcached stats after items have been added to the cache</p>
<div class="igBar"><span id="lcode-10"><a href="#" onclick="javascript:showPlainTxt('code-10'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-10">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">PS C:\&gt; memcached-stats <span style="color:#800000;color:#800000;">127</span>.<span style="color:#800000;color:#800000;">0</span>.<span style="color:#800000;color:#800000;">0</span>.<span style="color:#800000;color:#800000;">1</span> <span style="color:#800000;color:#800000;">11211</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Total items in cache:&nbsp; <span style="color:#800000;color:#800000;">3</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Stats for Slab:&nbsp; <span style="color:#800000;color:#800000;">1</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Key: <span style="color:#CC0000;">'resume-service:resume:adam-kahtava'</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Key: <span style="color:#CC0000;">'open-source-service:github:adamdotcom'</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Key: <span style="color:#CC0000;">'open-source-service:googlecode:adam.kahtava.com'</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Clearing all Memcached items</p>
<div class="igBar"><span id="lcode-11"><a href="#" onclick="javascript:showPlainTxt('code-11'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-11">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">PS C:\&gt; clear-memcached-items <span style="color:#800000;color:#800000;">127</span>.<span style="color:#800000;color:#800000;">0</span>.<span style="color:#800000;color:#800000;">0</span>.<span style="color:#800000;color:#800000;">1</span> <span style="color:#800000;color:#800000;">11211</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Total items in cache:&nbsp; <span style="color:#800000;color:#800000;">0</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Checking Memcached stats on a cleared instance</p>
<div class="igBar"><span id="lcode-12"><a href="#" onclick="javascript:showPlainTxt('code-12'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-12">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">PS C:\&gt; memcached-stats <span style="color:#800000;color:#800000;">127</span>.<span style="color:#800000;color:#800000;">0</span>.<span style="color:#800000;color:#800000;">0</span>.<span style="color:#800000;color:#800000;">1</span> <span style="color:#800000;color:#800000;">11211</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Total items in cache:&nbsp; <span style="color:#800000;color:#800000;">0</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Stats for Slab:&nbsp; <span style="color:#800000;color:#800000;">1</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Empty </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>If your test obsessed then you might be interested in the Memcached <a href="http://github.com/memcached/memcached/tree/master/t/">tests</a>.</p>
<p>As always feel free to contribute, view, or download the source <a href="http://github.com/AdamDotCom/memcached-on-powershell">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://adam.kahtava.com/journal/2010/03/09/memcached-on-powershell/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Sending Email With Attachments In PowerShell</title>
		<link>http://adam.kahtava.com/journal/2010/01/19/sending-email-with-attachments-in-powershell/</link>
		<comments>http://adam.kahtava.com/journal/2010/01/19/sending-email-with-attachments-in-powershell/#comments</comments>
		<pubDate>Tue, 19 Jan 2010 16:00:22 +0000</pubDate>
		<dc:creator>Adam Kahtava</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[PowerShell]]></category>

		<guid isPermaLink="false">http://adam.kahtava.com/journal/?p=2225</guid>
		<description><![CDATA[Here's an example on how to send email with attachments via PowerShell: PLAIN TEXT POWERSHELL: # A Mailer script that makes use of System.Net to send email with attachments # # Sample usage: #&#160; PS C:\&#62; Send-Mail-With-Attachment 'email@domain.com' 'Hello world!' 'Filename.txt' &#160; function global:Send-Mail-With-Attachment&#40;$to, $subject, $file&#41;&#123; &#160; &#160; $filenameAndPath = &#40;Resolve-Path .\$file&#41;.ToString&#40;&#41; &#160; $from = [...]]]></description>
			<content:encoded><![CDATA[<p>Here's an example on how to send email with attachments via PowerShell:</p>
<div class="igBar"><span id="lpowershell-14"><a href="#" onclick="javascript:showPlainTxt('powershell-14'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">POWERSHELL:</span>
<div id="powershell-14">
<div class="powershell">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #004400; font-style: italic;"># A Mailer script that makes use of System.Net to send email with attachments</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #004400; font-style: italic;">#</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #004400; font-style: italic;"># Sample usage:</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #004400; font-style: italic;">#&nbsp; PS C:\&gt; Send-Mail-With-Attachment 'email@domain.com' 'Hello world!' 'Filename.txt'</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">function</span> global:Send-Mail-With-Attachment<span style="color: #66cc66;">&#40;</span>$to, $subject, $file<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; $filenameAndPath = <span style="color: #66cc66;">&#40;</span><span style="color: #000066;">Resolve-Path</span> .\$file<span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">ToString</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; $from = <span style="color: #3366CC;">'Automated Powershell Mailer'</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #66cc66;">&#91;</span>void<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#91;</span>Reflection.<span style="color: #006600;">Assembly</span><span style="color: #66cc66;">&#93;</span>::LoadWithPartialName<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'System.Net'</span><span style="color: #66cc66;">&#41;</span> | out-null</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; $message = <span style="color: #000066;">New-Object</span> System.<span style="color: #006600;">Net</span>.<span style="color: #006600;">Mail</span>.<span style="color: #006600;">MailMessage</span><span style="color: #66cc66;">&#40;</span>$from, $to, $subject, $subject<span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; $attachment = <span style="color: #000066;">New-Object</span> System.<span style="color: #006600;">Net</span>.<span style="color: #006600;">Mail</span>.<span style="color: #006600;">Attachment</span><span style="color: #66cc66;">&#40;</span>$filenameAndPath, <span style="color: #3366CC;">'text/plain'</span><span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; $message.<span style="color: #006600;">Attachments</span>.<span style="color: #006600;">Add</span><span style="color: #66cc66;">&#40;</span>$attachment<span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; $smtpClient = <span style="color: #000066;">New-Object</span> System.<span style="color: #006600;">Net</span>.<span style="color: #006600;">Mail</span>.<span style="color: #006600;">SmtpClient</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; $smtpClient.<span style="color: #006600;">host</span> = <span style="color: #3366CC;">'mail.domain.com'</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; $smtpClient.<span style="color: #006600;">Send</span><span style="color: #66cc66;">&#40;</span>$message<span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Contribute, view, or download the script here: <a href="http://code.google.com/p/adamdotcom-script/source/browse/trunk/Scripts/PowerShell/Mailer.ps1">Mailer.ps1</a></p>
]]></content:encoded>
			<wfw:commentRss>http://adam.kahtava.com/journal/2010/01/19/sending-email-with-attachments-in-powershell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hacking Anti Cross-site Request Forgery Tokens (CSRF) With Powershell</title>
		<link>http://adam.kahtava.com/journal/2009/12/16/hacking-an-anti-cross-site-request-forgery-tokens-csrf-with-powershell/</link>
		<comments>http://adam.kahtava.com/journal/2009/12/16/hacking-an-anti-cross-site-request-forgery-tokens-csrf-with-powershell/#comments</comments>
		<pubDate>Wed, 16 Dec 2009 16:00:25 +0000</pubDate>
		<dc:creator>Adam Kahtava</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[ASP.NET MVC]]></category>
		<category><![CDATA[PowerShell]]></category>

		<guid isPermaLink="false">http://adam.kahtava.com/journal/?p=2149</guid>
		<description><![CDATA[I ported the example of how to hack an Anti CRSF Token protected form - previously shown in my post What Are Anti Cross-site Request Forgery Tokens And What Are They Good For? - to PowerShell. How to hack an Anti CRSF Token from PowerShell PLAIN TEXT POWERSHELL: function global:spam-adamdotcom&#40;&#41;&#123; &#160; &#160; # Load the assembly [...]]]></description>
			<content:encoded><![CDATA[<p>I ported the example of how to hack an Anti CRSF Token protected form - previously shown in my post <a href="http://adam.kahtava.com/journal/2009/11/25/what-are-anti-cross-site-request-forgery-tokens-and-what-are-they-good-for/">What Are Anti Cross-site Request Forgery Tokens And What Are They Good For?</a> - to PowerShell.</p>
<p><strong>How to hack an Anti CRSF Token from PowerShell</strong></p>
<div class="igBar"><span id="lpowershell-17"><a href="#" onclick="javascript:showPlainTxt('powershell-17'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">POWERSHELL:</span>
<div id="powershell-17">
<div class="powershell">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">function</span> global:spam-adamdotcom<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #004400; font-style: italic;"># Load the assembly containing WebClientWithCookies and RegexUtilities</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #66cc66;">&#91;</span>Reflection.<span style="color: #006600;">Assembly</span><span style="color: #66cc66;">&#93;</span>::LoadFile<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span><span style="color: #000066;">Resolve-Path</span> <span style="color: #3366CC;">"AdamDotCom.WebClientWithCookies.dll"</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> | out-null</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #004400; font-style: italic;"># Load the assembly containing System.Web.HttpUtilitiy</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #66cc66;">&#91;</span>void<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#91;</span>Reflection.<span style="color: #006600;">Assembly</span><span style="color: #66cc66;">&#93;</span>::LoadWithPartialName<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"System.Web"</span><span style="color: #66cc66;">&#41;</span> | out-null&nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #004400; font-style: italic;"># create a new instance of the HTTP Web Client that supports cookies</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; $webClient = <span style="color: #000066;">New-Object</span> AdamDotCom.<span style="color: #006600;">Common</span>.<span style="color: #006600;">Service</span>.<span style="color: #006600;">Utilities</span>.<span style="color: #006600;">WebClientWithCookies</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #004400; font-style: italic;"># download the page that contains the Anti CRSF Token</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #66cc66;">&#91;</span>void<span style="color: #66cc66;">&#93;</span> $webClient.<span style="color: #006600;">DownloadData</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"http://adam.kahtava.com/contact"</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #004400; font-style: italic;"># use a regular expression to grab the Anti CRSF Token</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #004400; font-style: italic;">#&nbsp; - this is an MVC site so we're looking for a token named &quot;__RequestVerificationToken_Lw__&quot;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; $regex = <span style="color: #3366CC;">"__RequestVerificationToken_Lw__=(?&lt;CRSF_Token&gt;[^;]+)"</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; $match = <span style="color: #66cc66;">&#91;</span>regex<span style="color: #66cc66;">&#93;</span>::matches<span style="color: #66cc66;">&#40;</span>$webClient.<span style="color: #006600;">ResponseHeaders</span><span style="color: #66cc66;">&#91;</span><span style="color: #3366CC;">"Set-Cookie"</span><span style="color: #66cc66;">&#93;</span>, $regex<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#91;</span><span style="color: #CC0000;color:#800000;">0</span><span style="color: #66cc66;">&#93;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; $antiCrsfToken = $match.<span style="color: #006600;">Groups</span><span style="color: #66cc66;">&#91;</span><span style="color: #3366CC;">"CRSF_Token"</span><span style="color: #66cc66;">&#93;</span>.<span style="color: #006600;">Captures</span><span style="color: #66cc66;">&#91;</span><span style="color: #CC0000;color:#800000;">0</span><span style="color: #66cc66;">&#93;</span>.<span style="color: #006600;">Value</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #000066;">write-host</span> <span style="color: #3366CC;">"<span style="color: #000099; font-weight: bold;">`n</span>Your Anti CRSF Token is: "</span> $antiCrsfToken</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #004400; font-style: italic;"># construct the message including the Anti CSRF Token</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; $message = <span style="color: #3366CC;">"__RequestVerificationToken="</span> + <span style="color: #66cc66;">&#91;</span>System.<span style="color: #006600;">Web</span>.<span style="color: #006600;">HttpUtility</span><span style="color: #66cc66;">&#93;</span>::UrlEncode<span style="color: #66cc66;">&#40;</span>$antiCrsfToken<span style="color: #66cc66;">&#41;</span> +</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #3366CC;">"&amp;amp;fromName=Johnathon Fink"</span> +</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #3366CC;">"&amp;amp;fromAddress=prancesw@rmcres.com"</span> +</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #3366CC;">"&amp;amp;subject=Call for your diploma now"</span> +</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #3366CC;">"&amp;amp;body=Is your lack of a degree..."</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #004400; font-style: italic;"># send spam-spam-spam</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; $webClient.<span style="color: #006600;">Headers</span>.<span style="color: #006600;">Add</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"Content-Type"</span>, <span style="color: #3366CC;">"application/x-www-form-urlencoded"</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #66cc66;">&#91;</span>void<span style="color: #66cc66;">&#93;</span> $webClient.<span style="color: #006600;">UploadData</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"http://adam.kahtava.com/contact/send"</span>, <span style="color: #3366CC;">"POST"</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#91;</span>System.<span style="color: #006600;">Text</span>.<span style="color: #006600;">Encoding</span><span style="color: #66cc66;">&#93;</span>::UTF8.<span style="color: #006600;">GetBytes</span><span style="color: #66cc66;">&#40;</span>$message<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #000066;">write-host</span> <span style="color: #3366CC;">"<span style="color: #000099; font-weight: bold;">`n</span>Success!!! Your spam has been sent.<span style="color: #000099; font-weight: bold;">`n</span>"</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p>
To run this script:</p>
<ol>
<li>Download the <a href="http://code.google.com/p/adamdotcom-script/source/browse/trunk/Scripts/PowerShell/Automated-AntiCSRF-Authentication-Script.ps1">script</a></li>
<li>Run PowerShell</li>
<li>Load the script: <code><a href="http://code.google.com/p/adamdotcom-script/source/browse/trunk/Scripts/PowerShell/Automated-AntiCSRF-Authentication-Script.ps1">.\Automated-AntiCSRF-Authentication-Script.ps1</a></code></li>
<li>Start sending spam-spam-spam: <code>PS &gt; spam-adamdotcom</code></li>
</ol>
<p>Here's the output as seen on my machine:</p>
<div class="igBar"><span id="lcode-18"><a href="#" onclick="javascript:showPlainTxt('code-18'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-18">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">PS C:\&gt; .\Automated-AntiCSRF-Authentication-Script.<span style="">ps1</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">PS C:\&gt; spam-adamdotcom</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Your Anti CRSF Token is:&nbsp; f54ZlHS3L1Xyl65dYd1uYYh90ygNKYmCswXJUnr0GYtgcrJdJILsQ2jyFotzc10L</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Success!!! Your spam has been sent. </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>This example uses a derivation of the .NET Framework's <a href="http://msdn.microsoft.com/en-us/library/system.net.webclient.aspx">Web Client</a> class but with Cookies enabled, so it depends on the <a href="http://adamdotcom-services.googlecode.com/svn/trunk/AdamDotCom.Common.Service/Final-Assemblies/AdamDotCom.Common.Service.dll">AdamDotCom.Common.Service.dll</a> assembly (browse the source <a href="http://code.google.com/p/adamdotcom-services/source/browse/trunk#trunk/AdamDotCom.Common.Service/Source/Common/Utilities">here</a>). This dependency can be automatically resolved by issuing the <code>download-client</code> function that's also found within the PowerShell script.</p>
<p>Contribute, view, or download the openly available script here: <a href="http://code.google.com/p/adamdotcom-script/source/browse/trunk/Scripts/PowerShell/Automated-AntiCSRF-Authentication-Script.ps1">Automated-AntiCSRF-Authentication-Script.ps1</a></p>
]]></content:encoded>
			<wfw:commentRss>http://adam.kahtava.com/journal/2009/12/16/hacking-an-anti-cross-site-request-forgery-tokens-csrf-with-powershell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Twitter on PowerShell</title>
		<link>http://adam.kahtava.com/journal/2008/12/05/twitter-on-powershell/</link>
		<comments>http://adam.kahtava.com/journal/2008/12/05/twitter-on-powershell/#comments</comments>
		<pubDate>Sat, 06 Dec 2008 01:04:40 +0000</pubDate>
		<dc:creator>Adam Kahtava</dc:creator>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Twitter]]></category>

		<guid isPermaLink="false">http://adam.kahtava.com/journal/PermaLink,guid,c66b0d9a-30ac-4d30-a104-a64f9d0a8f21.aspx</guid>
		<description><![CDATA[Adam Geras originally wrote a script in PowerShell that saves all the Twitter posts for a specific user into a file (view Mr. Geras original post here). I built on his script and extended it to: Post messages to Twitter Retrieve Twitter replies View my Twitter friends conversations Display the classic Twitter Fail Whale when [...]]]></description>
			<content:encoded><![CDATA[<p>Adam Geras originally wrote a script in <a href="http://en.wikipedia.org/wiki/Windows_PowerShell">PowerShell</a> that saves all the Twitter posts for a specific user into a file (<a href="http://testfirst.spaces.live.com/blog/cns%217E0657B7A0134A74%21230.entry">view Mr. Geras original post here</a>).</p>
<p>I built on his script and extended it to:</p>
<ul>
<li> Post messages to Twitter</li>
<li> Retrieve Twitter replies</li>
<li> View my Twitter friends conversations</li>
<li> Display the classic Twitter <a href="http://en.wikipedia.org/wiki/Twitter#Outages"><em>Fail Whale</em></a> when an error occurs</li>
</ul>
<h3>Screen Shots</h3>
<p>Sending a Twitter message:<br />
<img src="http://adam.kahtava.com/journal/images/blog/blog-post-twitter-powershell-tweet.png" alt="" /></p>
<p>Viewing my friends conversations:<br />
<img src="http://adam.kahtava.com/journal/images/blog/blog-post-twitter-powershell-friends.png" alt="" /></p>
<p>The classic Twitter <em>Fail Whale</em>:<br />
<img src="http://adam.kahtava.com/journal/images/blog/blog-post-twitter-powershell-fail-whale.png" alt="" /></p>
<p><em>There's something beautiful about the classic green console on a black background - I think it's about being closer to the metal. :) What do you think?</em></p>
<p>Contribute, view, or download the openly available script here: <a href="http://github.com/AdamDotCom/twitter-on-powershell">Twitter on Powershell</a></p>
]]></content:encoded>
			<wfw:commentRss>http://adam.kahtava.com/journal/2008/12/05/twitter-on-powershell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

