<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Bit Shifting on Remko's Blog</title><link>https://remkoweijnen.nl/blog/tags/bit-shifting/</link><description>Recent content in Bit Shifting on Remko's Blog</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Thu, 10 May 2012 12:14:36 +0000</lastBuildDate><atom:link href="https://remkoweijnen.nl/blog/tags/bit-shifting/index.xml" rel="self" type="application/rss+xml"/><item><title>Bit Shifting in PowerShell</title><link>https://remkoweijnen.nl/blog/2012/05/10/bit-shifting-in-powershell/</link><pubDate>Thu, 10 May 2012 12:14:36 +0000</pubDate><guid>https://remkoweijnen.nl/blog/2012/05/10/bit-shifting-in-powershell/</guid><description>&lt;p&gt;&lt;img style="display: inline; float: right" align="right" src="http://upload.wikimedia.org/wikipedia/commons/thumb/5/5c/Rotate_left_logically.svg/210px-Rotate_left_logically.svg.png" width="129" height="86" /&gt;I needed to dome some &lt;a href="http://en.wikipedia.org/wiki/Bitwise_operation#Logical_shift"&gt;Bit Shifting&lt;/a&gt; in PowerShell but unfortunately PowerShell lacks operator for Bit Shifting. I searched the .NET Framework for anything that allows for bit shifting but was unable to find anything suitable.&lt;/p&gt; &lt;p&gt;I didn't want to revert to C# so I implemented shift left and shift right functions in PowerShell.&lt;/p&gt; &lt;p&gt;The code isn't really pretty and could probably be improved (comments/improvements are welcome!) but here goes (please note that I implemented for bit shifting a byte):&lt;/p&gt;</description></item></channel></rss>