<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Geek Scribble</title>
	<atom:link href="http://geekscribble.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://geekscribble.wordpress.com</link>
	<description>Yes, it&#039;s yet another sysadmin&#039;s blog.</description>
	<lastBuildDate>Wed, 13 Apr 2011 02:26:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='geekscribble.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Geek Scribble</title>
		<link>http://geekscribble.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://geekscribble.wordpress.com/osd.xml" title="Geek Scribble" />
	<atom:link rel='hub' href='http://geekscribble.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Removing Unwanted Characters</title>
		<link>http://geekscribble.wordpress.com/2010/06/21/removing-unwanted-characters/</link>
		<comments>http://geekscribble.wordpress.com/2010/06/21/removing-unwanted-characters/#comments</comments>
		<pubDate>Mon, 21 Jun 2010 06:15:44 +0000</pubDate>
		<dc:creator>Ross</dc:creator>
				<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://geekscribble.wordpress.com/?p=77</guid>
		<description><![CDATA[Suppose you have a variable and you want to remove all unwanted characters from it &#8211; for example commas. In PowerShell, this is as easy as: To remove multiple unwanted characters, simply chain more -replace operators on the end (note that some characters must be escaped, as we are using a regex the escape character [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=geekscribble.wordpress.com&amp;blog=4849095&amp;post=77&amp;subd=geekscribble&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Suppose you have a variable and you want to remove all unwanted characters from it &#8211; for example commas.</p>
<p>In PowerShell, this is as easy as:</p>
<p><pre class="brush: plain;">
PS C:\&gt; 'a,,b,c,d,' -replace ','
abcd
</pre></p>
<p>To remove multiple unwanted characters, simply chain more -replace operators on the end (note that some characters must be escaped, as we are using a regex the escape character is a backslash):</p>
<p><pre class="brush: plain;">
PS C:\&gt; '.a,a\b,b\c,b\d\,d.\' -replace ',' -replace '\\' -replace '\.'
aabbcbdd
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/geekscribble.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/geekscribble.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/geekscribble.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/geekscribble.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/geekscribble.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/geekscribble.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/geekscribble.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/geekscribble.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/geekscribble.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/geekscribble.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/geekscribble.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/geekscribble.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/geekscribble.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/geekscribble.wordpress.com/77/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=geekscribble.wordpress.com&amp;blog=4849095&amp;post=77&amp;subd=geekscribble&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://geekscribble.wordpress.com/2010/06/21/removing-unwanted-characters/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3c8b6ce95a3f7965c031d488e1fb29d7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rossbrown2000</media:title>
		</media:content>
	</item>
		<item>
		<title>Converting from UNIX time to a PoSh DateTime object</title>
		<link>http://geekscribble.wordpress.com/2010/04/02/converting-from-unix-time-to-a-posh-datetime-object/</link>
		<comments>http://geekscribble.wordpress.com/2010/04/02/converting-from-unix-time-to-a-posh-datetime-object/#comments</comments>
		<pubDate>Fri, 02 Apr 2010 11:35:44 +0000</pubDate>
		<dc:creator>Ross</dc:creator>
				<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://geekscribble.wordpress.com/?p=65</guid>
		<description><![CDATA[Suppose you have a log file from a UNIX/Linux (or some derivative) system which has timestamps in UNIX time format and you want to convert them to shiny DateTime objects. Here&#8217;s an example of how to do that, wrapped in a PowerShell function for convenience: It returns a PowerShell DateTime object, so can then be [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=geekscribble.wordpress.com&amp;blog=4849095&amp;post=65&amp;subd=geekscribble&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Suppose you have a log file from a UNIX/Linux (or some derivative) system which has timestamps in <a href="http://en.wikipedia.org/wiki/Unix_time">UNIX time format</a> and you want to convert them to shiny DateTime objects. Here&#8217;s an example of how to do that, wrapped in a PowerShell function for convenience:</p>
<p><pre class="brush: plain;">
Function get-Unixdate ($UnixDate) {
    [timezone]::CurrentTimeZone.ToLocalTime(([datetime]'1/1/1970').`
    AddSeconds($UnixDate))
}
</pre></p>
<p>It returns a PowerShell DateTime object, so can then be manipulated using the standard DateTime methods, eg</p>
<p><pre class="brush: plain;">
PS&gt; $logtime = Get-UnixDate 1269313872.893866062
PS&gt; $logtime

Tuesday, 23 March 2010 4:11:12 p.m.

PS&gt; $logtime.IsDaylightSavingTime()
True
PS&gt; $logtime.dayofweek
Tuesday
PS&gt; $logtime.minute
11
PS&gt; $logtime.tostring(&quot;g&quot;)
23/03/2010 4:11 p.m.
PS&gt; $logtime.DayOfYear
82
PS&gt; $logtime.AddDays(-30)

Sunday, 21 February 2010 4:11:12 p.m.

PS&gt; ($logtime.adddays(14)).isdaylightsavingtime()
False
</pre></p>
<p>etc.</p>
<p>I have added the function to my profile, it comes in useful quite often.</p>
<p>Here&#8217;s some tips on <a href="http://www.microsoft.com/technet/scriptcenter/resources/pstips/oct07/pstip1026.mspx">working with PowerShell DateTime objects</a> and the MSDN documentation on <a href="http://msdn.microsoft.com/en-us/library/az4se3k1.aspx">formatting DateTime output</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/geekscribble.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/geekscribble.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/geekscribble.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/geekscribble.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/geekscribble.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/geekscribble.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/geekscribble.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/geekscribble.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/geekscribble.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/geekscribble.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/geekscribble.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/geekscribble.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/geekscribble.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/geekscribble.wordpress.com/65/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=geekscribble.wordpress.com&amp;blog=4849095&amp;post=65&amp;subd=geekscribble&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://geekscribble.wordpress.com/2010/04/02/converting-from-unix-time-to-a-posh-datetime-object/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3c8b6ce95a3f7965c031d488e1fb29d7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rossbrown2000</media:title>
		</media:content>
	</item>
	</channel>
</rss>
