<?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>PeetersOnline &#187; convert</title>
	<atom:link href="http://www.peetersonline.nl/index.php/tag/convert/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.peetersonline.nl</link>
	<description>Using Powershell for (virtually) everything!</description>
	<lastBuildDate>Fri, 19 Aug 2011 09:22:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>From HEX to DEC and back</title>
		<link>http://www.peetersonline.nl/index.php/powershell/from-hex-to-dec-and-back/</link>
		<comments>http://www.peetersonline.nl/index.php/powershell/from-hex-to-dec-and-back/#comments</comments>
		<pubDate>Tue, 20 Jan 2009 06:00:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[convert]]></category>
		<category><![CDATA[decimal]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[hexadecimal]]></category>

		<guid isPermaLink="false">http://www.peetersonline.nl/?p=280</guid>
		<description><![CDATA[Why do computer nerds mix up Halloween and Christmas? Because 31 OCT = 25 DEC :) I always mix up the commands used to convert integers to and from decimal, hexadecimal and octal in Powershell. That&#8217;s why I wrote these functions and put them in my profile: # Description: Coverts a decimal into a hexadecimal <a href='http://www.peetersonline.nl/index.php/powershell/from-hex-to-dec-and-back/'>[...]</a>
No related posts.]]></description>
			<content:encoded><![CDATA[<blockquote><p>Why do computer nerds mix up Halloween and Christmas? Because 31 OCT = 25 DEC :)</p></blockquote>
<p>I always mix up the commands used to convert integers to and from decimal, hexadecimal and octal in <a href="http://www.microsoft.com/windowsserver2003/technologies/management/powershell/default.mspx" target='_blank'>Powershell</a>. That&#8217;s why I wrote these functions and put them in my profile:</p>
<blockquote><p># Description: Coverts a decimal into a hexadecimal</p>
<p>function Convert-DECtoHEX<br />
{<br />
param($DEC)<br />
ForEach ($value in $DEC)<br />
{<br />
&#8220;{0:x}&#8221; -f [Int]$value<br />
}<br />
}</p></blockquote>
<blockquote><p># Description: Coverts a hexadecimal into a decimal</p>
<p>function Convert-HEXtoDEC<br />
{<br />
param($HEX)<br />
ForEach ($value in $HEX)<br />
{<br />
[Convert]::ToInt32($value,16)<br />
}<br />
}</p></blockquote>
<blockquote><p># Description: Coverts an octal into a decimal</p>
<p>function Convert-OCTtoDEC<br />
{<br />
param($OCT)<br />
ForEach ($value in $OCT)<br />
{<br />
[Convert]::ToInt32($value,8)<br />
}<br />
}</p></blockquote>
<p>Here are some example uses:<br />
<a href="http://www.peetersonline.nl/wp-content/2009-01-19_112552.jpg"><img class="alignnone size-full wp-image-281" title="2009-01-19_112552" src="http://www.peetersonline.nl/wp-content/2009-01-19_112552.jpg" alt="2009-01-19_112552" width="310" height="346" /></a></p>
<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.peetersonline.nl/index.php/powershell/from-hex-to-dec-and-back/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

