<?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>endjin blog &#187; Howard van Rooijen</title>
	<atom:link href="http://blogs.endjin.com/author/howard-vanrooijen/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.endjin.com</link>
	<description>work smarter</description>
	<lastBuildDate>Fri, 17 May 2013 07:00:40 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>PowerShell Best Kept Secrets: Splatting</title>
		<link>http://blogs.endjin.com/2013/05/powershell-best-kept-secrets-splatting/</link>
		<comments>http://blogs.endjin.com/2013/05/powershell-best-kept-secrets-splatting/#comments</comments>
		<pubDate>Fri, 03 May 2013 07:00:01 +0000</pubDate>
		<dc:creator>Howard van Rooijen</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Musings]]></category>
		<category><![CDATA[Samples]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Splatting]]></category>

		<guid isPermaLink="false">http://blogs.endjin.com/?p=6642</guid>
		<description><![CDATA[It&#8217;s been over a year since I wrote An Omega Geek’s Guide to Learning PowerShell, and I thought it was about time, with all the recent  noise about scriptcs, that PowerShell should get some more love as it&#8217;s a much overlooked and misunderstood gem of the .NET and Windows ecosystem. When I announced in the office that [...]]]></description>
				<content:encoded><![CDATA[<p>It&#8217;s been over a year since I wrote <a href="http://blogs.endjin.com/2012/03/an-omega-geeks-guide-to-learning-powershell/" target="_blank">An Omega Geek’s Guide to Learning PowerShell</a>, and I thought it was about time, with all the recent  noise about <a href="http://scriptcs.net/" target="_blank">scriptcs</a>, that PowerShell should get some more love as it&#8217;s a much overlooked and misunderstood gem of the .NET and Windows ecosystem. When I announced in the office that I was working on a blog post about splatting, it was met with cries of &#8220;what on earth is that?&#8221;, which is pretty much the same reception I get whenever I mention splatting to anyone.</p>
<p>This incredibly powerful feature of PowerShell probably wouldn&#8217;t be a best kept secret if it had a less ridiculous name.  If it was called by a more boring, yet descriptive name, such as “dynamic parameter matching” or even “parameter unfurling” it would at least give an indication as to what it actually did.</p>
<p>The standard way of passing values into PowerShell functions is via a named parameters, for example:</p>
<script src="https://gist.github.com/5498208.js"></script><noscript><pre><code class="language-powershell powershell">Function Print-TwoThings
{
    Param
    (
        [string]
        $First,
        
        [string]
        $Second
    )
    
    Write-Host (&quot;{0} {1}!&quot; -f $First, $Second)
}

Clear-Host
Print-TwoThings -First &quot;Hello&quot; -Second &quot;World&quot;</code></pre></noscript>
<p>which results in the output:</p>
<p><code>Hello World!</code></p>
<p>This is perfectly fine if you only have a few parameters, but if you are writing more complicated scripts (the standard example is some form of WMI query which requires a large number of parameters) it can become quite unwieldy.</p>
<p>Splatting allows you to convert those named parameters into a dictionary or hash and pass them into the function. The keys in the dictionary or hash will be examined to see if the match the names of the parameters and they do the values will be passed in. So if we refactor the above script to use splatting, it becomes:</p>
<script src="https://gist.github.com/5498347.js"></script><noscript><pre><code class="language-powershell powershell">Function Print-TwoThings
{
    Param
    (
        [string]
        $First,
        
        [string]
        $Second
    )
    
    Write-Host (&quot;{0} {1}!&quot; -f $First, $Second)
}

$parameters = @{
    First = &quot;Hello&quot;
    Second = &quot;World&quot;
}

Clear-Host
Print-TwoThings @parameters</code></pre></noscript>
<p>which results (as expected) in exactly the same output:</p>
<p><code>Hello World!</code></p>
<p>But the power of the splatting does not stop there. If you are working on more complicated PowerShell scripts, especially the kind that encapsulate workflow or automation steps (for deployments or environment provisioning) you generally have a top level orchestration function which then calls into a series of inner functions which carry out individual steps.</p>
<p>Without splatting it&#8217;s very cumbersome to try and pass values down through the call stack. But if you combine splatting with the power of the <a href="http://blogs.msdn.com/b/powershell/archive/2009/04/06/checking-for-bound-parameters.aspx" target="_blank">@PSBoundParameters</a> then you can pass the top level parameter collection down through the layers:</p>
<script src="https://gist.github.com/5498223.js"></script><noscript><pre><code class="language-powershell powershell">Function Outer-Method
{
    Param
    (
        [string]
        $First,
        
        [string]
        $Second
    )
    
    Write-Host ($First) -NoNewline
    
    Inner-Method @PSBoundParameters
}

Function Inner-Method
{
    Param
    (
        [string]
        $Second
    )
    
    Write-Host (&quot; {0}!&quot; -f $Second)
}

$parameters = @{
    First = &quot;Hello&quot;
    Second = &quot;World&quot;
}

Clear-Host
Outer-Method @parameters</code></pre></noscript>
<p>which results (as expected) in exactly the same output:</p>
<p><code>Hello World!</code></p>
<p>The combination of these two features leads to some truly interesting possibilities. We have <a href="http://endjin.com/Expertise/Development" target="_blank">various ALM offerings</a> around continuous deployment and environment provisioning, which has had <a href="http://endjin.com/our-work/rbs/alm#content" target="_blank">enormous positive impact on our client&#8217;s productivity</a>.  PowerShell has always played a major part in our automation story, but orchestrating the various scripts has always been a bit messy. Splatting has allowed us to refactor and distil our scripts to the point where our configuration data almost looks like a DSL, which drives the individual automation tasks.</p>
<p>The example below simulates the steps required to provision an IIS Website, Application Pool and to configure HTTP and HTTPS bindings. All the configuration data is held in a hash at the bottom of the example and is simply splatted into the top level orchestration function, the values are then automatically passed down to inner functions via the use of @PSBoundParameters.</p>
<script src="https://gist.github.com/5498260.js"></script><noscript><pre><code class="language-powershell powershell"># This is the public script we call as an entry point into the deployment / configuration process
Function Invoke-Deployment
{
    Param
    (
        $ApplicationPool,
        $WebSite
    )
    
    Invoke-AppPoolTasks @PSBoundParameters
    Invoke-WebSiteTasks @PSBoundParameters
}

# The main script for managing ApplicationPools
Function Invoke-AppPoolTasks
{
    Param
    (
        # this is essentially a hashtable that contains all the properties we need
        # we can then use PS dot notation to step into the property we want to access
        # as if we had a fully fledged object model
        $ApplicationPool 
    )
    
    Write-Host $ApplicationPool.Name
}

# The main script for managing WebSites
Function Invoke-WebSiteTasks
{
    Param
    (
        $WebSite
    )
    
    Write-Host $Website.Name
    Write-Host $Website.ApplicationPoolName
    
    # we can access each property manually, for example $Website.Bindings[0].Ip or by looping
    foreach($binding in $Website.Bindings)
    {
        Write-Host (&quot;{0}:{1}:{2}&quot; -f $binding.Ip, $binding.Port, $binding.HostName)
    }
}

# We can define a stronger object model, which is essentially dynamic and easy to extend
$parameters = @{
    ApplicationPool = @{ 
        Name = &quot;Endjin_Web_App_Pool&quot; 
    }
    WebSite = @{ 
        Name = &quot;Endjin_Web&quot;
        ApplicationPoolName = &quot;Endjin_Web_App_Pool&quot;
        Bindings = @( 
            @{ 
                Ip = &quot;192.168.100.10&quot;
                Port = &quot;80&quot;
                HostName = &quot;endjin.com&quot;
            },
            @{ 
                Ip = &quot;192.168.100.10&quot;
                Port = &quot;443&quot;
                HostName = &quot;endjin.com&quot;
            }
        )
    }
}

Clear-Host
Invoke-Deployment @parameters</code></pre></noscript>
<p>Which outputs the following:</p>
<p><code>Endjin_Web_App_Pool<br />
Endjin_Web<br />
Endjin_Web_App_Pool<br />
192.168.100.10:80:endjin.com<br />
192.168.100.10:443:endjin.com</code></p>
<p>As you can see, the combination of splatting, @PSBoundParameters and PowerShell&#8217;s dot notation (which allows you to reference an element in a dictionary by it&#8217;s key) allows you to create powerful, yet easy to understand PowerShell scripts.</p>
<p>@<a href="http://twitter.com/howardvrooijen" target="_blank">HowardvRooijen</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.endjin.com/2013/05/powershell-best-kept-secrets-splatting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Step by Step Guide to using GitFlow with TeamCity – Part 4 – Feature Branches in TeamCity</title>
		<link>http://blogs.endjin.com/2013/04/a-step-by-step-guide-to-using-gitflow-with-teamcity-part-4-feature-branches-in-teamcity/</link>
		<comments>http://blogs.endjin.com/2013/04/a-step-by-step-guide-to-using-gitflow-with-teamcity-part-4-feature-branches-in-teamcity/#comments</comments>
		<pubDate>Fri, 26 Apr 2013 07:00:35 +0000</pubDate>
		<dc:creator>Howard van Rooijen</dc:creator>
				<category><![CDATA[ALM]]></category>
		<category><![CDATA[DevOps]]></category>
		<category><![CDATA[Engineering Practices]]></category>
		<category><![CDATA[Step by Step Guides]]></category>
		<category><![CDATA[Git]]></category>
		<category><![CDATA[GitHub]]></category>
		<category><![CDATA[TeamCity]]></category>

		<guid isPermaLink="false">http://blogs.endjin.com/?p=5632</guid>
		<description><![CDATA[Part 1 of the series talked about Different Branching Models. Part 2 covered GitFlow – a Branching Model for a Release Cycle and part 3 covered all the GitFlow Commands. In this final part of this series about adopting GitFlow, we&#8217;re going to cover how we can use the exciting new feature branching abilities of TeamCity 7.1 to allow [...]]]></description>
				<content:encoded><![CDATA[<p>Part 1 of the series talked about <a href="http://blogs.endjin.com/2013/03/a-step-by-step-guide-to-using-gitflow-with-teamcity-part-1-different-branching-models/">Different Branching Models</a>. Part 2 covered <a href="http://blogs.endjin.com/2013/03/a-step-by-step-guide-to-using-gitflow-with-teamcity-part-2-gitflow-a-branching-model-for-a-release-cycle/">GitFlow – a Branching Model for a Release Cycle</a> and part 3 covered all the <a href="http://blogs.endjin.com/2013/04/a-step-by-step-guide-to-using-gitflow-with-teamcity-part-3-gitflow-commands/">GitFlow Commands</a>.</p>
<p>In this final part of this series about adopting GitFlow, we&#8217;re going to cover how we can use the exciting new <a href="http://confluence.jetbrains.com/display/TCD7/Working+with+Feature+Branches">feature branching</a> abilities of <a href="www.jetbrains.com/teamcity/">TeamCity</a> 7.1 to allow our continuous integration environment to work in harmony with GitFlow without incurring a DevOps overhead having to create build configurations to support all the different, sporadically created branches that the GitFlow process requires.</p>
<p>Enabling feature branching is very simple (as doing most things with TeamCity tends to be) &#8211; the first thing to remember is that you need TeamCity 7.1 or higher installed. I mentioned this because from the experience of many of <a href="http://endjin.com/our-work/" target="_blank">our clients</a> &#8211; a large number of people still seem to be running a TeamCity 6.5 install.</p>
<h2>Enabling Feature Branches</h2>
<p>For the project you are going to enable feature branching on, navigate to the &#8220;Edit VCS Root&#8221; page via: Administration &gt; Edit Build Configuration &gt; Edit VCS Root. The section you are interested in is the &#8220;Branch Specification&#8221; section:</p>
<p><img class="alignnone size-full wp-image-6082" alt="Enable Feature Branching" src="http://blogs.endjin.com/wp-content/uploads/2013/04/gitflow-teamcity-01.png" /></p>
<p>TeamCity enables feature branching by allowing you to create a branch specification &#8211; a simple little configuration syntax that has the format:<br />
<code>+:&lt;branch specification&gt;<br />
-:&lt;branch specification&gt;</code><br />
Where + means include and &#8211; means exclude. You can use * to perform matches, for example<br />
<code>+:*</code><br />
means include all branches, whereas<br />
<code>+:refs/heads/feature/*</code><br />
means include all feature branches.</p>
<p>For ease of copying and pasting the values for GitFlow are included below:<br />
<code>+:refs/heads/develop<br />
+:refs/heads/feature/*<br />
+:refs/heads/hotfix/*<br />
+:refs/heads/master<br />
+:refs/heads/release<br />
+:refs/heads/support/*</code><br />
One thing to note is that refs/heads/&lt;branch name&gt; is the fully qualified name of the branch rather than the shorter version of just &lt;branch name&gt; that we&#8217;re used to using.</p>
<h2>Feature Branch Builds</h2>
<p>Enabling feature branches has two knock on effects &#8211; the first is that you can now filter your builds by branch:</p>
<p><img class="alignnone size-full wp-image-6272" alt="" src="http://blogs.endjin.com/wp-content/uploads/2013/04/gitflow-teamcity-02.png" /></p>
<p>Branches are grouped into two main categories &#8220;active branches&#8221; and &#8220;inactive branches&#8221;. An active branch is any branch that has had a commit within the last 7 days (this value can be changed by altering the <em>teamcity.activeVcsBranch.age.days</em> parameter). Inactive branches are ones older than the specified threshold. The reason branches &#8220;decay&#8221; is because on any project of reasonable size the number of concurrent branches can become large quite quickly.</p>
<p>If these branches didn&#8217;t become &#8220;inactive&#8221; the UI would soon become cluttered and unusable. In the screenshot above &#8211; you can see we have two active branches &#8211; develop and &#8220;gf005&#8243;, which is actually the id of the task within YouTrack. We like to use this convention for branch names as it makes it easy for anyone on the project to figure out which changes are in which branch.</p>
<p>If you want an unfiltered view of current activity, you can select &#8220;Active branches&#8221;:</p>
<p><img class="alignnone size-full wp-image-6282" alt="gitflow-teamcity-03" src="http://blogs.endjin.com/wp-content/uploads/2013/04/gitflow-teamcity-03.png" /></p>
<p>The final knock on effect is that there is a new option available from the &#8220;Run Custom Build&#8221; dialog. This is very handy if you want to perform any advanced functions against a specific branch, for example deploy a specific version of a build from a specific branch (if you are using TeamCity as your deployment dashboard).</p>
<p><img class="alignnone size-full wp-image-6292" alt="gitflow-teamcity-04" src="http://blogs.endjin.com/wp-content/uploads/2013/04/gitflow-teamcity-04.png" /></p>
<p>That&#8217;s really how easy it is to configure TeamCity to work with the GitFlow process. It may seem daunting at the outset &#8211; but hopefully this step by step guide illuminates how straight forward the process really is and might persuade you to invest a little more time experimenting with and improving <a href="http://endjin.com/Expertise/Development#developmentaccordion" target="_blank">your own ALM processes</a>.</p>
<p>If you have any questions about the process &#8211; feel free to leave a comment or ping me via @<a href="http://twitter.com/HowardvRooijen" target="_blank">HowardvRooijen</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.endjin.com/2013/04/a-step-by-step-guide-to-using-gitflow-with-teamcity-part-4-feature-branches-in-teamcity/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Templify 0.7.0.25 is available.</title>
		<link>http://blogs.endjin.com/2013/04/templify-0-7-0-25-is-available/</link>
		<comments>http://blogs.endjin.com/2013/04/templify-0-7-0-25-is-available/#comments</comments>
		<pubDate>Wed, 24 Apr 2013 15:26:29 +0000</pubDate>
		<dc:creator>Howard van Rooijen</dc:creator>
				<category><![CDATA[OSS]]></category>
		<category><![CDATA[Templify]]></category>

		<guid isPermaLink="false">http://blogs.endjin.com/?p=5742</guid>
		<description><![CDATA[Templify is a simple tool that aims to solve one simple problem and solve it well: Every project starts the same way, You create a place to put Solution Artefacts On one file system On one computer Templify allows you to create a tokenised template of your entire solution. So if you&#8217;ve got a default [...]]]></description>
				<content:encoded><![CDATA[<p><a href="http://opensource.endjin.com/templify/">Templify </a>is a simple tool that aims to solve one simple problem and solve it well:</p>
<blockquote><p><em>Every project starts the same way,</em><br />
<em>You create a place to put Solution Artefacts</em><br />
<em>On one file system</em><br />
<em>On one computer</em></p></blockquote>
<p>Templify allows you to create a tokenised template of your entire solution. So if you&#8217;ve got a default web application framework, which includes a build system, some deployment scripts and other goodies and you want a way to package the whole solution up and allow others to share and reuse it, Templify is the answer.</p>
<p>It&#8217;s now almost three years old and quite a bit has changed in the world since then one of the main things being that NuGet has appeared and made package management a thing in the .NET world. The &#8220;package restore&#8221; functionality is especially interesting, as it allows you to package up just the source files for a solution without having to include the binaries, which vastly increase the size of any redistributable zip of a solution or demo you&#8217;d want to share.</p>
<p>In that three year period there have only really been two major bugs reported &#8211; the first was more a complaint than a bug &#8211; sometimes packing and unpacking a Templify package could be very slow. Thankfully <a href="https://github.com/ondesertverge">a kindly user</a> of Templify decided to try and get to the bottom of the problem and fixed it. The second problem reported was that some users found that Templify altered the file encoding (it would convert a file from ANSI to UTF8) of any file it tokenised. Luckily we had already solved this problem in another one of our internal build and deployment tools, so it was quite straight forward to make an IP donation to the Templify project.</p>
<p>One of the other changes to happen in the last three years is that Visual Studio 2012 was released and one of its key features is that it no-longer supports Visual Studio Installer Projects, which Templify uses. So as part of this new release I&#8217;ve created a new <a href="http://www.advancedinstaller.com/" target="_blank">Advanced Installer</a> based installer and our very own <a href="http://blogs.endjin.com/author/paul-waller/" target="_blank">Paul Waller</a> decided to spruce up the installer graphics to align with <a href="http://endjin.com" target="_blank">our new brand and website</a>.</p>
<p><img class="alignnone size-full wp-image-5762" alt="templify-installer" src="http://blogs.endjin.com/wp-content/uploads/2013/04/templify-installer.png" width="509" height="399" /></p>
<p>The latest version is now <a href="http://opensource.endjin.com/templify/download.htm" target="_blank">available for download</a>, please provide any feedback via the <a href="https://github.com/endjin/Templify" target="_blank">GitHub page</a>.</p>
<p>@<a href="http://twitter.com/howardvrooijen" target="_blank">HowardvRooijen</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.endjin.com/2013/04/templify-0-7-0-25-is-available/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>A Step by Step Guide to using GitFlow with TeamCity – Part 3 – GitFlow Commands</title>
		<link>http://blogs.endjin.com/2013/04/a-step-by-step-guide-to-using-gitflow-with-teamcity-part-3-gitflow-commands/</link>
		<comments>http://blogs.endjin.com/2013/04/a-step-by-step-guide-to-using-gitflow-with-teamcity-part-3-gitflow-commands/#comments</comments>
		<pubDate>Fri, 05 Apr 2013 06:39:51 +0000</pubDate>
		<dc:creator>Howard van Rooijen</dc:creator>
				<category><![CDATA[ALM]]></category>
		<category><![CDATA[DevOps]]></category>
		<category><![CDATA[Engineering Practices]]></category>
		<category><![CDATA[Step by Step Guides]]></category>
		<category><![CDATA[Git]]></category>
		<category><![CDATA[GitFlow]]></category>
		<category><![CDATA[GitHub]]></category>
		<category><![CDATA[PoshGit]]></category>
		<category><![CDATA[SmartGit]]></category>
		<category><![CDATA[TeamCity]]></category>

		<guid isPermaLink="false">http://blogs.endjin.com/?p=3392</guid>
		<description><![CDATA[In part 1 of the series I talked about the difference in branching models inherent with the different types of version control system. In part 2 I talked about the problems inherent in the software development, release and support cycle and how GitFlow was designed as a workflow to try and solve or at the [...]]]></description>
				<content:encoded><![CDATA[<p>In <a href="http://blogs.endjin.com/2013/03/a-step-by-step-guide-to-using-gitflow-with-teamcity-part-1-different-branching-models/">part 1 of the series</a> I talked about the difference in branching models inherent with the different types of version control system. In <a href="http://blogs.endjin.com/2013/03/a-step-by-step-guide-to-using-gitflow-with-teamcity-part-2-gitflow-a-branching-model-for-a-release-cycle/">part 2</a> I talked about the problems inherent in the software development, release and support cycle and how GitFlow was designed as a workflow to try and solve or at the very lease provide a strategy to try and minimise their impact.</p>
<p>This post finally covers the nitty-gritty of how you use the GitFlow extensions to drive the workflow. Firstly the extensions add a new command, &#8220;flow&#8221; which has 4 sub commands (and one experimental &#8211; &#8220;support&#8221;) which encapsulate the workflow:</p>
<h2>&gt; git flow</h2>
<ul>
<li>init</li>
<li>feature</li>
<li>release</li>
<li>hotfix</li>
<li>support</li>
</ul>
<p>As each GitFlow command has a series of options &#8211; it&#8217;s probably best to cover them off one by one:</p>
<h2>&gt; git flow init</h2>
<p>This command initializes your existing git repo to use the GitFlow extensions. The extensions don&#8217;t perform voodoo magic &#8211; they don&#8217;t do anything special to your repo &#8211; they are simply scripts that automate a series of existing git commands to create a &#8220;pit of quality&#8221; that allows you to easily follow the conventions &#8211; if you had an aversion to working smarter you could manually run all the git steps, following the same conventions and achieve the same ends &#8211; but why go the long way round?</p>
<p>When you run the following command:<br />
<code>&gt; git flow init</code><br />
You will be ask if you want to override the default naming pattern (hint &#8211; you don’t, but it&#8217;s always nice to be asked).</p>
<p><img class="alignnone size-full wp-image-1862" alt="sbsgtgf-08a-git-flow-init" src="http://blogs.endjin.com/wp-content/uploads/2013/03/sbsgtgf-08a-git-flow-init.png" /></p>
<p>If you find having to hit enter multiple times bothersome then you can use the following command to initialise your git repo with the default settings:<br />
<code>&gt; git flow init –fd</code><br />
The screenshot below shows the difference:</p>
<p><img class="alignnone size-full wp-image-1872" alt="sbsgtgf-08b-git-flow-init" src="http://blogs.endjin.com/wp-content/uploads/2013/03/sbsgtgf-08b-git-flow-init.png" /></p>
<h2>&gt; git flow feature</h2>
<p>This is probably the command you will most use in your day-to-day development activities. In essence it doesn&#8217;t do anything particularly special &#8211; it just creates a branch in which you can develop a feature. The point is that it&#8217;s a very low friction way of creating an isolated sandpit for you to create a new feature in. Just like any other branch in git, you can push it up to a remote repo to share it with other developers to collaborate and push, pull and rebase just like you would if you developed just in the master branch.</p>
<p>The point of the feature branch is that it should contain a small unit of work (we&#8217;re talking hours or days worth of work, not weeks or months) and that there can be many feature branches being worked on independently as in the following workflow visualisation:</p>
<p><img class="size-full wp-image-1882 alignnone" alt="GitFlow Feature Branches" src="http://blogs.endjin.com/wp-content/uploads/2013/03/sbsgtgf-09-git-flow-feature.png" width="242" height="720" /></p>
<p>The full list of GitFlow feature commands are as follows (many of them should not be a shock to the system as they are just standard git commands):</p>
<ul>
<li>git flow feature [list] [-v]</li>
<li>git flow feature start [-F] &lt;name&gt; [&lt;base&gt;]</li>
<li>git flow feature finish [-rFkDS] [&lt;name|nameprefix&gt;]</li>
<li>git flow feature publish &lt;name&gt;</li>
<li>git flow feature track &lt;name&gt;</li>
<li>git flow feature diff [&lt;name|nameprefix&gt;]</li>
<li>git flow feature rebase [-i] [&lt;name|nameprefix&gt;]</li>
<li>git flow feature checkout [&lt;name|nameprefix&gt;]</li>
<li>git flow feature pull [-r] &lt;remote&gt; [&lt;name&gt;]</li>
</ul>
<p>The most common commands you will use are the following:</p>
<ul>
<li>start &lt;name&gt;</li>
<li>finish &lt;name&gt;</li>
<li>publish &lt;name&gt;</li>
<li>track &lt;name&gt;</li>
<li>checkout &lt;name&gt;</li>
<li>pull &lt;remote&gt; &lt;name&gt;</li>
</ul>
<h2>&gt; git flow feature start &lt;name&gt;</h2>
<p>Naming your feature branch is an interesting topic &#8211; our standard is to use the Id of the work item you are delivering &#8211; in our internal devlab that is the YouTrack Id. The reason we do this is so that it&#8217;s absolutely apparent to anyone in the team what a particular branch relates to. This convention works well for hotfixes too as these are generally recorded as bugs in your work item tracking system.</p>
<p>The screenshot below shows the process of creating a new feature for a specific work item id (gf006). GitFlow provides you with a nice set of instructions on what to do at the next step of the workflow.</p>
<p><img class="alignnone size-full wp-image-1892" alt="sbsgtgf-10-git-flow-feature" src="http://blogs.endjin.com/wp-content/uploads/2013/03/sbsgtgf-10-git-flow-feature.png" /></p>
<p>To backtrack to the &#8220;the extensions don&#8217;t perform voodoo magic&#8221; point the command:<br />
<code>&gt; git flow feature start</code><br />
Translates to:<br />
<code>&gt; git branch feature/&lt;name&gt;<br />
&gt; git checkout feature/&lt;name&gt;<br />
</code></p>
<h2>&gt; git flow feature publish &lt;name&gt;</h2>
<p>Now you&#8217;ve created a feature branch &#8211; you might want commit your initial changes either to ensure they are backed up on the remote or to collaborate with other colleagues. To do this you need to issued the following command:<br />
<code>&gt;git flow feature publish &lt;name&gt;</code><br />
This command translates to the following native commands:<br />
<code>&gt; git push origin &lt;name&gt;<br />
&gt; git config "branch.&lt;name&gt;.remote" "origin"<br />
&gt; git config "branch.&lt;name&gt;.merge" "refs/heads/&lt;name&gt;"<br />
&gt; git checkout "&lt;name&gt;"<br />
</code></p>
<h2>&gt; git flow feature pull &lt;name&gt;</h2>
<p>Similarly if you are the other collaborator and want to get the feature branch, you would issue the following command:<br />
<code>&gt; git flow feature pull &lt;name&gt;</code><br />
For the first time feature pull, translates to:<br />
<code>&gt; git fetch -q "origin" "&lt;name&gt;"<br />
&gt; git branch –no-track "&lt;name&gt;" FETCH_HEAD<br />
&gt; git checkout -q "&lt;name&gt;"</code><br />
And for any subsequent feature pull translates to:<br />
<code>&gt; git pull -q "origin" "&lt;name&gt;"</code></p>
<h2>&gt; git flow feature finish &lt;name&gt;</h2>
<p>Once you completed work on your feature, it&#8217;s time to merge it back with the main develop branch. To do this you need to issue the following command:<br />
<code>&gt; git flow feature finish</code><br />
This translates to the following native commands:<br />
<code>&gt; git checkout develop<br />
&gt; git merge –no-ff "&lt;name&gt;"<br />
&gt; git branch -d &lt;name&gt;</code></p>
<h2>&gt; git flow release</h2>
<p>Now you have a feature that&#8217;s complete, you probably want to bundle this up into a release so that you can push it into Production. The purpose of this branch is to test, stabilize and finally release the changes. The diagram below visualizes the workflow, showing how features eventually make there way into a Release branch:</p>
<p><img class="alignnone size-full wp-image-1902" alt="sbsgtgf-11-git-flow-release" src="http://blogs.endjin.com/wp-content/uploads/2013/03/sbsgtgf-11-git-flow-release.png" /></p>
<p>As you can collaboratively make changes to code in the branch &#8211; the sub-commands available are very much aligned with those available for feature branches:</p>
<ul>
<li>git flow release start &lt;version&gt;</li>
<li>git flow release finish &lt;version&gt;</li>
<li>git flow release publish &lt;name&gt;</li>
<li>git flow release track &lt;name&gt;</li>
</ul>
<h2>&gt; git flow release start &lt;name&gt;</h2>
<p>Just like a feature branch you need to &#8220;start&#8221; it &#8211; the screenshot below shows the process of creating a release branch called &#8220;iteration01&#8243; from within the feature branch &#8220;gf006&#8243;. Note how the release branch is created from the &#8220;develop&#8221;  branch rather than the feature branch:</p>
<p><img alt="sbsgtgf-12-git-flow-release-start" src="http://blogs.endjin.com/wp-content/uploads/2013/03/sbsgtgf-12-git-flow-release-start.png" /></p>
<p>Now the branch is successfully created and testing and stabilisation can continue.</p>
<h2>&gt; git flow release finish &lt;name&gt;</h2>
<p>One your release has exited the final quality gate and is ready to be released into production &#8211; you can &#8220;finish&#8221; the branch. Note from the screenshot that you should provide a message.</p>
<p><img alt="sbsgtgf-13-git-flow-release-finish" src="http://blogs.endjin.com/wp-content/uploads/2013/03/sbsgtgf-13-git-flow-release-finish.png" /></p>
<p>This command is a façade for a whole series workflow steps:</p>
<p><code>&gt; git flow release finish -F -p iteration01</code><br />
Translates to:<br />
<code>&gt; git checkout master<br />
&gt; git fetch origin master<br />
&gt; git merge –no-ff iteration01<br />
&gt; git tag -a iteration01<br />
&gt; git push origin master<br />
&gt; git checkout develop<br />
&gt; git fetch origin develop<br />
&gt; git merge –no-ff iteration01<br />
&gt; git push origin develop<br />
&gt; git branch –d iteration01</code><br />
If you are not familiar with the standard git commands &#8211; the above steps translate, in English to:</p>
<ul>
<li>Latest objects have been fetched from &#8220;origin&#8221;</li>
<li>Release branch has been merged into &#8220;master&#8221;</li>
<li>The release was tagged &#8220;iteration01&#8243;</li>
<li>Release branch has been back-merged into &#8220;develop&#8221;</li>
<li>Release branch &#8220;release/iteration01&#8243; has been deleted</li>
<li>&#8220;develop&#8221;, &#8220;master&#8221; and tags have been pushed to &#8220;origin&#8221;</li>
<li>Release branch &#8220;release/iteration01&#8243; in &#8220;origin&#8221; has been deleted</li>
</ul>
<p>At this point the changes for your next release exist on your master branch and have been tagged with the version number specified.</p>
<h2>&gt; git flow hotfix</h2>
<p>The hotfix command has been created to solve the problem of defects slipping through the quality gates and being identified in production. This branch exists to allow a single defect to be fixed, tested and then merged back into the master branch. This is not a process for adding extra features into the production release &#8211; this should only be used to fix a specific defect &#8211; any other features should be handled in the normal way using feature branches. The diagram below visualizes the workflow:</p>
<p><img class="alignnone size-full wp-image-1932" alt="sbsgtgf-14-git-flow-hotfix" src="http://blogs.endjin.com/wp-content/uploads/2013/03/sbsgtgf-14-git-flow-hotfix.png" /></p>
<p>The following sub-commands are available:</p>
<ul>
<li>git flow hotfix start &lt;version&gt;</li>
<li>git flow hotfix finish &lt;version&gt;</li>
<li>git flow hotfix publish &lt;version&gt;</li>
<li>git flow hotfix track &lt;version&gt;</li>
</ul>
<h2>&gt; git flow support</h2>
<p>This is still considered an experimental feature for the case where a team has a product that supports multiple customers who need fixes but don’t want to upgrade to new release. The diagram below visualizes the workflow:</p>
<p><img class="alignnone size-full wp-image-1942" alt="sbsgtgf-15-git-flow-support" src="http://blogs.endjin.com/wp-content/uploads/2013/03/sbsgtgf-15-git-flow-support.png" /></p>
<p>And that&#8217;s it &#8211; GitFlow is a simple, low ceremony set of extensions to automate a simple convention for managing the complexities of dealing with the software development release cycle.</p>
<p>In the <a href="http://blogs.endjin.com/2013/04/a-step-by-step-guide-to-using-gitflow-with-teamcity-part-4-feature-branches-in-teamcity/">final part of this series</a>, I&#8217;ll show how you can configure TeamCity to work in harmony with GitFlow.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.endjin.com/2013/04/a-step-by-step-guide-to-using-gitflow-with-teamcity-part-3-gitflow-commands/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>A Step by Step Guide to using GitFlow with TeamCity – Part 2 – GitFlow &#8211; a Branching Model for a Release Cycle</title>
		<link>http://blogs.endjin.com/2013/03/a-step-by-step-guide-to-using-gitflow-with-teamcity-part-2-gitflow-a-branching-model-for-a-release-cycle/</link>
		<comments>http://blogs.endjin.com/2013/03/a-step-by-step-guide-to-using-gitflow-with-teamcity-part-2-gitflow-a-branching-model-for-a-release-cycle/#comments</comments>
		<pubDate>Fri, 29 Mar 2013 06:00:57 +0000</pubDate>
		<dc:creator>Howard van Rooijen</dc:creator>
				<category><![CDATA[ALM]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[DevOps]]></category>
		<category><![CDATA[Engineering Practices]]></category>
		<category><![CDATA[Step by Step Guides]]></category>
		<category><![CDATA[Chocolatey]]></category>
		<category><![CDATA[Git]]></category>
		<category><![CDATA[GitFlow]]></category>
		<category><![CDATA[PoshGit]]></category>

		<guid isPermaLink="false">http://blogs.endjin.com/?p=2152</guid>
		<description><![CDATA[In Part 1 &#8211; I covered off a brief overview of the branching model differences between TFS and Git. One of the most interesting developments to happen in the Git ecosystem (apart from its growing adoption rate) is the creation of the Git Flow branching model and its embodiment as an plugin extension to the core Git client libraries. [...]]]></description>
				<content:encoded><![CDATA[<p>In <a href="http://blogs.endjin.com/2013/03/a-step-by-step-guide-to-using-gitflow-with-teamcity-part-1-different-branching-models/" target="_blank">Part 1</a> &#8211; I covered off a brief overview of the branching model differences between TFS and Git.</p>
<p>One of the most interesting developments to happen in the Git ecosystem (apart from its growing adoption rate) is the creation of the <a href="http://nvie.com/posts/a-successful-git-branching-model/">Git Flow branching model</a> and its <a href="https://github.com/nvie/gitflow">embodiment as an plugin extension</a> to the core Git client libraries.</p>
<p>GitFlow sets out to answer the following questions that plague every software development team:</p>
<p>How can we:</p>
<ul>
<li>Keep our repository tidy?</li>
<li>Have consistency between projects?</li>
<li>Get our developers up to speed quickly with our procedures?</li>
<li>Enable the team develop a feature in isolation from the main branch, but also allows them to collaborate?</li>
<li>Stabilize before a production release?</li>
<li>Manage production releases?</li>
<li>Manage production hotfixes?</li>
<li>Customize our codebase for a specific customer without that affecting another customer?</li>
</ul>
<p>The solution GitFlow proposes is a prescriptive branching model, born of experience which answers the questions above, and a set of Git Extensions that allow you to manage and automate work through that model.</p>
<p>GitFlow specifies the following branch structure:</p>
<ul>
<li>master</li>
<li>hotfixes</li>
<li>release branches</li>
<li>develop</li>
<li>feature branches</li>
</ul>
<h2>Master</h2>
<p>Instead of the master branch being the default bucket where all changes happen, in GitFlow the purpose of this branch is to contain code that&#8217;s in a production ready state. You should be able to deploy code from this branch into production at any time and the code in this branch can be tagged with a specific release number to aid that process. This is quite a change for most development teams where 99% of the development happens in the master branch. GitFlow enables you to put a quality gate around the master branch, using workflow, as it requires actual effort to create a release, and then merge that release back into master.</p>
<h2>Hotfixes</h2>
<p>This branch is a special case for dealing with urgent defects discovered in production post release. The purpose of the branch is that you make a single change to fix the issue (you do not slip other features into this fix as this could introduce other stability issues). This change is then folded into the master branch and also into the develop branch.</p>
<h2>Release Branches</h2>
<p>This branch is used for gathering features for future release. This branch is also useful for release stabilisation &#8211; making changes required to fix issues discovered by any final exploratory testing.</p>
<h2>Develop</h2>
<p>This is the branch where &#8220;general&#8221; development activities can occur (rather than on the master branch). This branch can become the general bucket for all changes &#8211; but this is really not how it should be used. Any piece of significant work should be done inside a feature branch.</p>
<h2>Feature Branches</h2>
<p>These branches are for developing an individual feature &#8211; this can be dictation by a set of required changes, a backlog item, a bug &#8211; essentially any unit of work that needs to be carried out. These branches are short lived &#8211; they should not be used for weeks or months on end (otherwise you will incur large integration problems as code on this branch will be out of date compared to all the other work going on).</p>
<h2>Visualising the Workflow</h2>
<p>The easiest way to visualize the pattern is a process flow diagram, showing how changes flow through the development cycle. The arrows signify the creation of or merging of a branch, the dots represent a commit:</p>
<p><img class="size-full wp-image-2272 aligncenter" alt="sbsgtgf-05-branches" src="http://blogs.endjin.com/wp-content/uploads/2013/03/sbsgtgf-05-branches1.png" /></p>
<p>Just to re-iterate one point &#8211; <em>branches should not be long lived</em> &#8211; they are not another mechanism to allow developers to <em>go dark:</em> the longer a branch lives, the more pain you are incurring for yourself (and your team) when you come to re-integrate your changes. GitFlow is not a silver bullet to solve all your release cycle problems, it&#8217;s a pattern and workflow for reducing the friction, but the work still has to be managed; hotfixes, features and releases have to be planned and managed &#8211; otherwise you have just added complexity to the chaos.</p>
<h2>Installing GitFlow</h2>
<p>There are two ways in which you can install GitFlow:</p>
<ul>
<li>Download getopt.exe &amp; libintl3.dll from <a href="http://bit.ly/XdYcBc">http://bit.ly/XdYcBc</a></li>
<li>Extract and copy to: C:\Program Files\Git\bin</li>
<li>Clone the GitFlow Repo, but running the following command from Git Bash:</li>
</ul>
<p><code> $ git clone --recursive git://github.com/nvie/gitflow.git<br />
$ cd gitflow<br />
</code></p>
<ul>
<li>Run &#8220;C:\gitflow&gt; contrib\msysgit-install.cmd&#8221; as Administrator</li>
</ul>
<p>Or you can:</p>
<ul>
<li>Download <a href="https://dl.dropbox.com/u/5892928/DevTools/Endjin.DevTools.Git-Flow.7z">https://dl.dropbox.com/u/5892928/DevTools/Endjin.DevTools.Git-Flow.7z</a></li>
<li>Unzip and run <em>Configure-GitFlow.ps1</em></li>
</ul>
<p>As GitFlow is a series of Git command line extensions &#8211; you&#8217;ll need a nice command line environment (if you don&#8217;t already have one).</p>
<h2>Using Chocolatey to install Posh-Git</h2>
<p><a title="Chocolatey Package Manager" href="http://chocolatey.org/">Chocolatey</a> seems to be one of those &#8220;best kept secrets&#8221; on the Microsoft world &#8211; it&#8217;s essentially apt-get but based on the NuGet feed protocol. To install Chocolatey first you just need to open a PowerShell prompt and execute the following command:<br />
<code>@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('http://chocolatey.org/install.ps1'))" &amp;&amp; SET PATH=%PATH%;%systemdrive%\chocolatey\bin</code><br />
<img class="alignnone size-full wp-image-1832" alt="sbsgtgf-06b-chocolately" src="http://blogs.endjin.com/wp-content/uploads/2013/03/sbsgtgf-06b-chocolately.png" width="922" height="449" /></p>
<p>Now you have Chocolatey installed &#8211; you can use it to install Posh-Git &#8211; which essentially allows you to use Git from within your PowerShell environment. Issue the following command:<br />
<code>c:\&gt; cinst poshgit</code><br />
Chocolatey will locate, download and install Posh-Git.</p>
<p>When you navigate to a Git repo inside the PowerShell command environment you should get extra information about the state of the repo and which branch you are currently on. This is very useful when using GitFlow</p>
<p><a href="http://blogs.endjin.com/wp-content/uploads/2013/03/sbsgtgf-06c-poshgit.png"><img class="alignnone size-full wp-image-1842" alt="sbsgtgf-06c-poshgit" src="http://blogs.endjin.com/wp-content/uploads/2013/03/sbsgtgf-06c-poshgit.png" /></a></p>
<p>Now you should have your environment correctly set up to use GitFlow. In the <a href="http://blogs.endjin.com/2013/04/a-step-by-step-guide-to-using-gitflow-with-teamcity-part-3-gitflow-commands/">next part of the series</a>, we&#8217;ll cover off how to actually use it.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.endjin.com/2013/03/a-step-by-step-guide-to-using-gitflow-with-teamcity-part-2-gitflow-a-branching-model-for-a-release-cycle/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>A Step by Step Guide to using GitFlow with TeamCity &#8211; Part 1 &#8211; Different Branching Models</title>
		<link>http://blogs.endjin.com/2013/03/a-step-by-step-guide-to-using-gitflow-with-teamcity-part-1-different-branching-models/</link>
		<comments>http://blogs.endjin.com/2013/03/a-step-by-step-guide-to-using-gitflow-with-teamcity-part-1-different-branching-models/#comments</comments>
		<pubDate>Fri, 22 Mar 2013 06:00:31 +0000</pubDate>
		<dc:creator>Howard van Rooijen</dc:creator>
				<category><![CDATA[ALM]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[DevOps]]></category>
		<category><![CDATA[Engineering Practices]]></category>
		<category><![CDATA[Step by Step Guides]]></category>
		<category><![CDATA[Chocolatey]]></category>
		<category><![CDATA[Git]]></category>
		<category><![CDATA[GitFlow]]></category>
		<category><![CDATA[GitHub]]></category>
		<category><![CDATA[PoshGit]]></category>
		<category><![CDATA[SmartGit]]></category>
		<category><![CDATA[SVN]]></category>
		<category><![CDATA[TeamCity]]></category>
		<category><![CDATA[TFS]]></category>
		<category><![CDATA[VSS]]></category>
		<category><![CDATA[YouTrack]]></category>

		<guid isPermaLink="false">http://blogs.endjin.com/?p=1742</guid>
		<description><![CDATA[When we setup endjin in 2010, there were five activities we did on day one: set up a business bank account, set up a FreeAgent account, for all our accounting needs signed up for Office 365 (or BPOS as it was then), registered the endjin GitHub account built a virtualised Continuous Integration Environment using TeamCity. [...]]]></description>
				<content:encoded><![CDATA[<p>When we setup endjin in 2010, there were five activities we did on day one:</p>
<ul>
<li>set up a business bank account,</li>
<li>set up a <a href="http://www.freeagent.com/?referrer=225tvy">FreeAgent account</a>, for all our accounting needs</li>
<li>signed up for Office 365 (or BPOS as it was then),</li>
<li>registered the <a href="http://github.com/endjin">endjin GitHub account</a></li>
<li>built a virtualised Continuous Integration Environment using <a href="http://www.jetbrains.com/teamcity/">TeamCity</a>.</li>
</ul>
<p>With those 5 simple steps, we had all the systems we needed to run our company.</p>
<p>Quite a bit has changed within the company in the last 24 months, but Git &amp; TeamCity have remained an absolute cornerstone of how we do day to day development and “work smarter”; teaching other companies to do the same has become one of our core <a title="Our Development Expertise" href="http://endjin.com/Expertise/Development#secondarynav" target="_blank">consultancy offerings in the ALM / DevOps space</a>. It’s no co-incidence that on <a href="http://blog.endjin.com/2012/08/day-1-powershell-bdd-and-git/">his first day</a>, <a href="http://blog.endjin.com/2012/08/mike-larah-is-an-apprentice-endjineer/">our apprentice</a> was shown how to set up and configure a GitHub repository and push his first commit, or that we publish <a href="http://blog.endjin.com/2010/11/a-step-by-step-guide-to-hosting-teamcity-in-iis-7/">a Step by Step guide to Hosting TeamCity in IIS 7</a> or that <a href="http://blog.endjin.com/2012/03/teamcitypowershell/">we released a set of PowerShell cmdlets</a> for managing and interrogating TeamCity.</p>
<p>These systems are absolutely fundamental to what we do.</p>
<p>To anyone who has worked within the Microsoft space and has grown up using Visual Source Safe or Team Foundation Server, branching is something to be feared and avoided at all costs unless you want daily nose bleeds.</p>
<p>In these systems, changes are stored as deltas or changesets, the result of which is that in their branching model, branches sit side by side on your file system.</p>
<p><a href="http://blogs.endjin.com/wp-content/uploads/2013/03/sbsgtgf-01-traditional-branching.png"><img class="alignnone size-full wp-image-1772" alt="traditional branching" src="http://blogs.endjin.com/wp-content/uploads/2013/03/sbsgtgf-01-traditional-branching.png" /></a></p>
<p>This means that to create or swap between branches has significant overheads, which means if you’re developing something like a web application, you have to reconfigure IIS to point at the branch you’re currently working on. Also every branch you create requires N amount of disk space, where N is the size of the main branch. Nothing insurmountable, but just added <i>friction</i>.</p>
<h2>Along came Git</h2>
<p>Git is the total antidote. Rather than pay a branching tax, it’s actually a bit more like getting a branching rebate. Git stores changes as snapshots, therefore a branch is simply a moveable pointer to a specific commit (the actual implementation detail is that a branch is actually a SHA1 checksum of the commit).</p>
<blockquote><p>“I&#8217;m an egotistical bastard, and I name all my projects after myself.<br />
First &#8216;Linux&#8217;, now &#8216;git&#8217;.”</p>
<p>Linus Torvalds<br />
Creator of Linux &amp; Git</p></blockquote>
<p>Instead of having multiple branches coexisting side-by-side on your system, in Git creating a new branch involves writing 41 bytes to a file.</p>
<p><a href="http://blogs.endjin.com/wp-content/uploads/2013/03/sbsgtgf-02-git-branching.png"><img class="alignnone size-full wp-image-2072" alt="sbsgtgf-02-git-branching" src="http://blogs.endjin.com/wp-content/uploads/2013/03/sbsgtgf-02-git-branching.png" /></a></p>
<p>My favourite way of describing the difference between the TFS and Git branching models is as follows, in TFS &#8211; branching is essentially like the TV Show Fringe in that you have to deal with parallel worlds crossing between those world is a difficult process with severe health risks to the person &#8220;crossing over&#8221;, whereas with Git is more like Doctor Who: branching is essentially dealing with time streams where you can easily go forwards, backwards and even sideways.</p>
<p>&nbsp;</p>
<p><a href="http://blogs.endjin.com/wp-content/uploads/2013/03/sbsgtgf-03-parallel-branching.png"><img class="alignnone size-full wp-image-1792" alt="sbsgtgf-03-parallel-branching" src="http://blogs.endjin.com/wp-content/uploads/2013/03/sbsgtgf-03-parallel-branching.png" /></a></p>
<p><strong>vs.</strong></p>
<p><a href="http://blogs.endjin.com/wp-content/uploads/2013/03/sbsgtgf-04-wibbly-wobbly-timey-wimey.png"><img class="alignnone size-full wp-image-1802" alt="sbsgtgf-04-wibbly-wobbly-timey-wimey" src="http://blogs.endjin.com/wp-content/uploads/2013/03/sbsgtgf-04-wibbly-wobbly-timey-wimey.png" /></a></p>
<p>So it&#8217;s essentially Parallel Worlds vs. Wibbly Wobbly, Timey Wimey. And we all know bow ties are cool.</p>
<p>In the<a href="http://blogs.endjin.com/2013/03/a-step-by-step-guide-to-using-gitflow-with-teamcity-part-2-gitflow-a-branching-model-for-a-release-cycle/"> second part</a> of this series &#8211; we&#8217;ll tell you a little bit more about the GitFlow branching model and how to get your development environment set-up and configured.</p>
<p>@<a href="http://twitter.com/howardvrooijen" target="_blank">HowardvRooijen</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.endjin.com/2013/03/a-step-by-step-guide-to-using-gitflow-with-teamcity-part-1-different-branching-models/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Agile:MK January 2013 Meeting</title>
		<link>http://blogs.endjin.com/2013/01/agilemk-january-2013-meeting/</link>
		<comments>http://blogs.endjin.com/2013/01/agilemk-january-2013-meeting/#comments</comments>
		<pubDate>Mon, 07 Jan 2013 10:39:39 +0000</pubDate>
		<dc:creator>Howard van Rooijen</dc:creator>
				<category><![CDATA[Agile]]></category>
		<category><![CDATA[AgileMK]]></category>
		<category><![CDATA[Kanban]]></category>
		<category><![CDATA[Lean]]></category>
		<category><![CDATA[Milton Keynes]]></category>
		<category><![CDATA[Scrum]]></category>
		<category><![CDATA[Sponsorship]]></category>
		<category><![CDATA[User Groups]]></category>

		<guid isPermaLink="false">http://endjinblog.azurewebsites.net/?p=612</guid>
		<description><![CDATA[Technologists who work in London are very spoilt for choice when it comes to user groups &#8211; there are generally more on in any month that any single person can attend. Unfortunately if you live or work outside of London &#8211; depending on the area &#8211; it can be a bit desolate. Endjin are proud [...]]]></description>
				<content:encoded><![CDATA[<p>Technologists who work in London are very spoilt for choice when it comes to user groups &#8211; there are generally more on in any month that any single person can attend. Unfortunately if you live or work outside of London &#8211; depending on the area &#8211; it can be a bit desolate.</p>
<p>Endjin are proud to sponsor <a title="Agile:MK" href="http://agile-mk.site44.com/" target="_blank">Agile:MK</a> a new user group for Agile Practitioners based in / around the Milton Keynes area.</p>
<p>The January meeting is on the Tuesday the 15th from 6pm – 8pm at Jurys Inn Hotel, Midsummer Boulevard, Milton Keynes, <a href="http://goo.gl/maps/DMdlk" target="_blank">MK9 2HP</a></p>
<p>To be part of Agile:MK <a href="http://tinyurl.com/agile-mk-liug" target="_blank">signup via the LinkedIn Group</a>.</p>
<p>If you cannot attend the meetings &#8211; do not fear &#8211; you can still keep up to date with all the goings on via the Agile:MK Journal, Issue 1 is available to download by clicking on the image below:</p>
<p><a href="http://agile-mk.site44.com/journal/Agile-MK-Journal-Issue-001.pdf" target="_blank" rel="attachment wp-att-613"><img class="alignnone size-medium wp-image-613" alt="Agile-MK-Journal-Issue-001" src="http://endjinblog.azurewebsites.net/wp-content/uploads/2013/01/Agile-MK-Journal-Issue-001-212x300.png" width="212" height="300" /></a></p>
<p>@<a href="http://twitter.com/howardvrooijen" target="_blank">HowardvRooijen</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.endjin.com/2013/01/agilemk-january-2013-meeting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Calculating Distance using SQL Server Spatial CLR Types</title>
		<link>http://blogs.endjin.com/2012/10/calculating-distance-using-sql-server-spatial-clr-types/</link>
		<comments>http://blogs.endjin.com/2012/10/calculating-distance-using-sql-server-spatial-clr-types/#comments</comments>
		<pubDate>Sat, 20 Oct 2012 18:52:26 +0000</pubDate>
		<dc:creator>Howard van Rooijen</dc:creator>
				<category><![CDATA[Samples]]></category>
		<category><![CDATA[Geocoding]]></category>
		<category><![CDATA[Sample]]></category>
		<category><![CDATA[Spatial]]></category>
		<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">http://endjinblog.azurewebsites.net/?p=603</guid>
		<description><![CDATA[I created a quick sample to solve a problem today and thought I&#8217;d post the code as it took me a while to track down all the relevant bits of information. The problem I wanted to solve was that I wanted to be able to geocode a user&#8217;s postcode and then calculate the distance between [...]]]></description>
				<content:encoded><![CDATA[<p>I created a quick sample to solve a problem today and thought I&#8217;d post the code as it took me a while to track down all the relevant bits of information.</p>
<p>The problem I wanted to solve was that I wanted to be able to geocode a user&#8217;s postcode and then calculate the distance between their location and another. There are plenty of paid for services out there but I remembered reading a blog post by <a title="Steve Wright's Blog" href="http://zogamorph.blogspot.co.uk" target="_blank">Steve Wright</a> about <a title="How to load spatial data into SQL Server" href="http://zogamorph.blogspot.co.uk/2009/01/how-to-load-spatial-data-into-sql.html" target="_blank">manipulating spatial data to get it into SQL Server</a>.</p>
<p>The following sample utilises the Sql Server Spatial Types Assembly, which can be <a href="http://nuget.org/packages/Microsoft.SqlServer.Types" target="_blank">found on NuGet</a>. Essentially it allows you to create a SqlGeography type from two strings that represent Longitude and Latitude, utilising the SqlGeography.STGeomFromText method and then calculate the Distance using the STDistance method (on the SqlGeography instance) to calculate the distance (in meters) between the two points. There&#8217;s a simple helper method to calculate the distance into Miles.</p>
<script src="https://gist.github.com/3928025.js"></script><noscript><pre><code class="language-c# c#">namespace Endjin.Sql.Spatial.Example
{
    #region Using Directives

    using System;
    using System.Data.SqlTypes;

    using Microsoft.SqlServer.Types;

    #endregion 

    /// &lt;summary&gt;
    /// Sample app that uses SQL Spatial Types to calculate the distance between two locations.
    /// &lt;/summary&gt;
    /// &lt;remarks&gt;
    /// If you want to find our a specific lon / lat use http://www.doogal.co.uk/LatLong.php
    /// &lt;/remarks&gt;
    public class Program
    {
        public static void Main(string[] args)
        {
            const int WorldGeodeticSystemId = 4326;

            var firstlocationLonLat = new Tuple&lt;string, string&gt;(&quot;-0.081389&quot;, &quot;51.502195&quot;);
            var secondlocationLonLat = new Tuple&lt;string, string&gt;(&quot;-0.185348&quot;, &quot;51.410933&quot;);

            var firstLocationAsPoint = string.Format(&quot;POINT({0} {1})&quot;, firstlocationLonLat.Item1, firstlocationLonLat.Item2);
            var secondLocationAsPoint = string.Format(&quot;POINT({0} {1})&quot;, secondlocationLonLat.Item1, secondlocationLonLat.Item2);

            var firstLocation = SqlGeography.STGeomFromText(new SqlChars(firstLocationAsPoint), WorldGeodeticSystemId);
            var secondLocation = SqlGeography.STGeomFromText(new SqlChars(secondLocationAsPoint), WorldGeodeticSystemId);

            var distance = firstLocation.STDistance(secondLocation);

            Console.WriteLine(&quot;First Location is &quot; + MetersToMiles((double)distance).ToString(&quot;0&quot;) + &quot; miles from Second Location&quot;);
            Console.ReadKey();
        }

        public static double MetersToMiles(double? meters)
        {
            if (meters == null)
            {
                return 0F;
            }

            return meters.Value * 0.000621371192;
        }
    }
}</code></pre></noscript>
<p>The solution is available from the <a href="https://github.com/endjin/Samples" target="_blank">endjin Samples repo on GitHub</a>.</p>
<p>@<a href="http://twitter.com/howardvrooijen" target="_blank">HowardvRooijen</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.endjin.com/2012/10/calculating-distance-using-sql-server-spatial-clr-types/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>TeamCity PowerShell</title>
		<link>http://blogs.endjin.com/2012/03/teamcitypowershell/</link>
		<comments>http://blogs.endjin.com/2012/03/teamcitypowershell/#comments</comments>
		<pubDate>Wed, 28 Mar 2012 22:48:03 +0000</pubDate>
		<dc:creator>Howard van Rooijen</dc:creator>
				<category><![CDATA[ALM]]></category>
		<category><![CDATA[DevOps]]></category>
		<category><![CDATA[Engineering Practices]]></category>
		<category><![CDATA[OSS]]></category>
		<category><![CDATA[BDD]]></category>
		<category><![CDATA[dotPeek]]></category>
		<category><![CDATA[JetBrains]]></category>
		<category><![CDATA[Pester]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[TeamCity]]></category>

		<guid isPermaLink="false">http://endjinblog.azurewebsites.net/?p=429</guid>
		<description><![CDATA[Last week I was formally invited to become a member of the JetBrains Development Academy Board – to celebrate, I decided to give something back to the community that has a JetBrains flavour. As I mentioned in my last post – we’ve been doing a lot of ALM / DevOps work in the last year [...]]]></description>
				<content:encoded><![CDATA[<p>Last week I was formally invited to become a member of the JetBrains Development Academy Board – to celebrate, I decided to give something back to the community that has a JetBrains flavour. As I mentioned <a href="http://endjinblog.azurewebsites.net/2012/03/an-omega-geeks-guide-to-learning-powershell/" target="_blank">in my last post</a> – we’ve been doing a lot of ALM / DevOps work in the last year and some of those projects have involved implementing TeamCity and other have involved using a lot of PowerShell – so I thought it would be a good idea to combine to two.</p>
<p>Rather than implement a PowerShell API from scratch I decided to “work smarter” and stand on the shoulders of giants – in this case fellow JetBrains Academy Member <a href="https://twitter.com/#!/stack72" target="_blank">Paul Stack</a>, who created a very nice C# TeamCity Wrapper called <a href="https://github.com/stack72/TeamCitySharp" target="_blank">TeamCitySharp</a>.</p>
<p>PowerShell is hosted on the CLR – so calling .NET types is a breeze – it was very straightforward to wrap the C# API. Firstly I used <a href="http://www.jetbrains.com/decompiler/" target="_blank">dotPeek</a> to list all the method names and I pasted these into a new PowerShell script and converted each of them into the vanilla <a href="https://github.com/scottmuc/Pester" target="_blank">Pester BDD</a> format and outlined some behaviours:</p>
<script src="https://gist.github.com/5008064.js"></script><noscript><pre><code class="language-powershell powershell">Describe &quot;Get-AllAgents&quot; {
    It &quot;should return multiple agents&quot; {
    }
}</code></pre></noscript>
<p>The next step was to create the parameters to pass into the cmdlet. To start with I mimicked the C# API and had expressive function signatures – but after writing the first couple of cmdlets did a small refactoring and switched to using <a href="http://technet.microsoft.com/en-us/magazine/gg675931.aspx" target="_blank">splatting</a> (one of the most unknown / underused features of PowerShell), which allowed me to create a pseudo ConnectionDetails object that is in fact a hashtable – which is a much nicer data structure for describing all the different connection options. The final step is to test the results of your cmdlet.</p>
<script src="https://gist.github.com/5008142.js"></script><noscript><pre><code class="language-powershell powershell">$ConnectionDetails = @{
   ServerUrl = &quot;teamcity.codebetter.com&quot;
   Credential = New-Object System.Management.Automation.PSCredential(&quot;teamcitysharpuser&quot;, (ConvertTo-SecureString &quot;qwerty&quot; -asplaintext -force))
}

Describe &quot;Get-AllAgents&quot; {
    $parameters = @{ ConnectionDetails = $ConnectionDetails }
    $result = Get-AllAgents @parameters
    It &quot;should return multiple agents&quot; {
       $result.Count.should.have_count_greater_than(1)
    }
}</code></pre></noscript>
<p>This test will obviously fail as we haven’t implemented the Get-AllAgents cmdlet – but that’s simple enough to fix:</p>
<script src="https://gist.github.com/5008151.js"></script><noscript><pre><code class="language-powershell powershell">Function Get-AllAgents
{
   param
   (
      [Hashtable]
      $ConnectionDetails
   )

   $client = New-TeamCityConnection @PSBoundParameters
   return $client.AllAgents()
}</code></pre></noscript>
<p>Note the use of <em>@PSBoundParameters</em> – this allows you to splat the parameters passed into the current cmdlet into a nested cmdlet. Very cool indeed and saves a lot of typing.<br />
I repeated the process for the rest of the TeamCitySharp API and created the following cmdlets:</p>
<ul>
<li>Get-AllAgents</li>
<li>Get-AllBuildConfigs</li>
<li>Get-ArtifactsByBuildId</li>
<li>Get-Artifact</li>
<li>Get-ArtifactsAsArchive *</li>
<li>Get-BuildConfigByConfigurationName</li>
<li>Get-AllBuildsOfStatusSinceDate</li>
<li>Get-AllBuildsSinceDate</li>
<li>Get-AllChanges</li>
<li>Get-AllGroupsByUserName</li>
<li>Get-AllProjects</li>
<li>Get-AllRolesByUserName *</li>
<li>Get-AllServerPlugins *</li>
<li>Get-AllUserGroups</li>
<li>Get-AllUserRolesByUserGroup</li>
<li>Get-AllUsers *</li>
<li>Get-AllUsersByUserGroup</li>
<li>Get-AllVcsRoots</li>
<li>Get-BuildConfigByConfigurationId</li>
<li>Get-BuildConfigByConfigurationName</li>
<li>Get-BuildConfigByProjectIdAndConfigurationId</li>
<li>Get-BuildConfigByProjectIdAndConfigurationName</li>
<li>Get-BuildConfigByProjectNameAndConfigurationId</li>
<li>Get-BuildConfigByProjectNameAndConfigurationName</li>
<li>Get-BuildConfigsByBuildConfigId</li>
<li>Get-BuildConfigsByConfigIdAndTag</li>
<li>Get-BuildConfigsByConfigIdAndTags</li>
<li>Get-BuildConfigsByProjectId</li>
<li>Get-BuildConfigsByProjectName</li>
<li>Get-BuildsByBuildLocator *</li>
<li>Get-BuildsByUserName</li>
<li>Get-ChangeDetailsByBuildConfigId</li>
<li>Get-ChangeDetailsByChangeId</li>
<li>Get-ErrorBuildsByBuildConfigId *</li>
<li>Get-FailedBuildsByBuildConfigId *</li>
<li>Get-LastBuildByAgent</li>
<li>Get-LastBuildByBuildConfigId</li>
<li>Get-LastChangeDetailByBuildConfigId</li>
<li>Get-LastErrorBuildByBuildConfigId *</li>
<li>Get-LastFailedBuildByBuildConfigId</li>
<li>Get-LastSuccessfulBuildByBuildConfigId</li>
<li>Get-LatestArtifact</li>
<li>Get-NonSuccessfulBuildsForUser</li>
<li>Get-ProjectById</li>
<li>Get-ProjectByName</li>
<li>Get-ServerInfo</li>
<li>Get-SuccessfulBuildsByBuildConfigId</li>
<li>Get-VcsRootById</li>
</ul>
<p><sup>* denotes a cmdlet that has been implemented but doesn’t have a passing test (mainly due to a lack of rights on the <a href="http://teamcity.codebetter.com">http://teamcity.codebetter.com</a> server).</sup></p>
<p>Although the tests are integration tests and a little slow to run – there is nothing more reassuring than having a full suite of specifications:</p>
<p><a href="http://endjinblog.azurewebsites.net/wp-content/uploads/2012/03/teamcity-powershell-specs.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="teamcity-powershell-specs" alt="teamcity-powershell-specs" src="http://endjinblog.azurewebsites.net/wp-content/uploads/2012/03/teamcity-powershell-specs_thumb.png" width="789" height="462" border="0" /></a></p>
<p>A simple example of using the TeamCityPowerShell API is as follows:</p>
<script src="https://gist.github.com/5008157.js"></script><noscript><pre><code class="language-powershell powershell">$parameters = @{
     ConnectionDetails = @{
         ServerUrl = &quot;teamcity.codebetter.com&quot;
         Credential = New-Object System.Management.Automation.PSCredential(&quot;teamcitysharpuser&quot;, (ConvertTo-SecureString &quot;qwerty&quot; -asplaintext -force))
     }
     BuildConfigId = &quot;bt437&quot;
}

$builds = Get-BuildConfigsByBuildConfigId @parameters

foreach($build in $builds)
{
    Write-Host $build.Number
}</code></pre></noscript>
<p>Very straight forward.</p>
<p>If you don’t want to store your TeamCity credentials in plain text you can either enter them interactively using the following code:</p>
<script src="https://gist.github.com/5008168.js"></script><noscript><pre><code class="language-powershell powershell">$parameters = @{
   ConnectionDetails = @{
      ServerUrl = &quot;teamcity.codebetter.com&quot;
      Credential = Get-Credential
   }
   BuildConfigId = &quot;bt437&quot;
}</code></pre></noscript>
<p>Alternatively you can retrieve them disk using this PowerShell Cookbook recipe: <a href="http://www.leeholmes.com/blog/2008/06/04/importing-and-exporting-credentials-in-powershell/" target="_blank">Importing and Exporting Credentials in PowerShell</a></p>
<p>One item to note - TeamCityPowerShell depends on TeamCitySharp which is a .NET 4.0 application. By default PowerShell only supports .NET 2.0 &#8211; to enable .NET 4.0 support copy TeamCityPowerShell\SetUp\PowerShell.exe.config to the PowerShell install directory &#8211; this allows PowerShell to host the .NET 4.0 runtime.</p>
<p>You can find <a href="https://github.com/endjin/TeamCityPowerShell" target="_blank">TeamCityPowershell on GitHub</a>. If you have any feedback – please get in contact.</p>
<p>@<a href="https://twitter.com/#!/howardvrooijen" target="_blank">HowardvRooijen</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.endjin.com/2012/03/teamcitypowershell/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>An Omega Geek&#8217;s Guide to Learning PowerShell</title>
		<link>http://blogs.endjin.com/2012/03/an-omega-geeks-guide-to-learning-powershell/</link>
		<comments>http://blogs.endjin.com/2012/03/an-omega-geeks-guide-to-learning-powershell/#comments</comments>
		<pubDate>Tue, 27 Mar 2012 10:50:28 +0000</pubDate>
		<dc:creator>Howard van Rooijen</dc:creator>
				<category><![CDATA[ALM]]></category>
		<category><![CDATA[DevOps]]></category>
		<category><![CDATA[Engineering Practices]]></category>
		<category><![CDATA[Work Smarter Not Harder]]></category>
		<category><![CDATA[PowerShell]]></category>

		<guid isPermaLink="false">http://endjinblog.azurewebsites.net/2012/03/an-omega-geeks-guide-to-learning-powershell/</guid>
		<description><![CDATA[In the last 12 months we’ve been doing quite a lot of Application Lifecycle Management (ALM) projects helping teams setup Continuous Delivery processes. One of the tenets of Continuous Delivery is “Automate Everything” – which has been a core part of my “work smarter, not harder” ethic for a number of years. The technology that [...]]]></description>
				<content:encoded><![CDATA[<p>In the last 12 months we’ve been doing quite a lot of Application Lifecycle Management (ALM) projects helping teams setup <a href="http://continuousdelivery.com/">Continuous Delivery</a> processes. One of the tenets of Continuous Delivery is “Automate Everything” – which has been a core part of my “work smarter, not harder” ethic for a number of years. The technology that we’ve been using to do this work is one of the hidden gems of the Microsoft Platform – PowerShell. It amazed me that a technology that is over <a href="http://consultingblogs.emc.com/howardvanrooijen/archive/2006/06/04/4032.aspx" target="_blank">6 years old</a> still doesn’t seem to have mass adoption within the Microsoft Development Community. While the Alpha Geeks are frothing at the mouth over new tech such as Node / HTML 5 / WinRT, I really hope that more Omega Geeks will do themselves a great favour and start to learn PowerShell.</p>
<p>I’ve spent more of the last year working inside <a href="http://powergui.org">PowerGUI</a> than Visual Studio and I’ve tried hard to take a few of our customers on the learning journey too. I’m very pleased that after doing a quick brown bag session about PowerShell and knocking up a sample framework that one of the DevOps folks took it and ran with it – automating the provisioning of their internal development, test and production environments – from a series of thick word documents that took over 2 man days to work through (and were also horrifically prone to human error) to a series of PowerShell scripts that could automatically provision an environment within a couple of hours.</p>
<p>Thankfully there are a myriad of resources to help you learn PowerShell here are a select that I’ve found very useful:</p>
<p><strong>Free Guides</strong></p>
<p>If you really want to get your head around what comes out of the box in PowerShell 2.0 (which is installed by default on Windows 7 and Windows Server 2008) a great place to start is <a href="http://www.jonathanmedd.net/" target="_blank">Jonathan Medd’s</a> – <a href="http://www.jonathanmedd.net/wp-content/uploads/2010/09/PowerShell_2_One_Cmdlet_at_a_Time.pdf" target="_blank">PowerShell 2 – One Cmdlet at a Time</a> – which does exactly what it says on the tin – it lists every cmdlet (think function) and tells you what it does and how to use it.</p>
<p>One of the least known and most powerful features in PowerShell is remoting – the ability to execute PowerShell scripts, in context on a remote machine. This opens so many doors from a DevOps perspective. On the downside – because remoting requires you to deal with networks and security – it can be a bit painful to get up and running with and another indispensible guide is <a href="http://www.ravichaganti.com/blog/" target="_blank">Ravikanth Chaganti</a>’s &#8211; <a href="http://www.ravichaganti.com/blog/wp-content/plugins/download-monitor/download.php?id=22" target="_blank">Layman’s Guide to PowerShell 2.0 remoting</a> – to tell the truth – I felt bad reading this free guide – the amount of real world knowledge and blood, sweat and tears problem solving is of such a high quality that it really shouldn’t be a free ebook.</p>
<p><strong>Books</strong></p>
<p>The two free guides really wet my appetite and I wanted more – both depth and breadth and I found this in abundance in <a href="http://www.manning-sandbox.com/forum.jspa?forumID=542" target="_blank">Bruce Payette’s</a> – <a href="http://www.amazon.co.uk/gp/product/1935182137/ref=as_li_ss_tl?ie=UTF8&amp;tag=benchpeg-21&amp;linkCode=as2&amp;camp=1634&amp;creative=19450&amp;creativeASIN=1935182137" target="_blank">PowerShell in Action 2nd Edition</a> – if you want a holistic view of the platform – it’s a great start. If you want a more practical guide to how to use PowerShell there are two other great resources – first is <a href="http://www.windowsitpro.com/blogcontent/powershell-with-a-purpose-blog-36" target="_blank">Don Jones</a> and his book <a href="http://www.manning.com/jones/" target="_blank">Learn Windows PowerShell in a Month of Lunches</a>. Don is a bit of a star he’s very active not only on his <a href="https://twitter.com/#!/concentrateddon" target="_blank">twitter account</a> – but he’s also produced a seriously large number of accompanying <a href="http://www.youtube.com/user/ConcentratedDon" target="_blank">screencasts, freely available on YouTube</a>. The second is <a href="http://www.leeholmes.com/blog/" target="_blank">Lee Holmes</a> (who’s been on the PowerShell team from the start), his book <a href="http://www.amazon.co.uk/gp/product/0596801505" target="_blank">The PowerShell Cookbook</a> is a wonderful resource – brimming with Problem –&gt; Solution recipes; if you’re getting started with PowerShell these are the type of problems you are going to hit straight away and such The PowerShell Cookbook should be your first port of call. The latest PowerShell book I’ve been reading is <a href="http://www.manning.com/siddaway2/" target="_blank">PowerShell and WMI</a> by Richard Siddaway which is a little more advanced and hard-core – but useful for those of us who want to interact with Windows Machines at a lower level.</p>
<p><strong>Blogs &amp; People</strong></p>
<p>As always the first place for a Microsoft Technology is the <a href="http://blogs.msdn.com/b/powershell/" target="_blank">Official Microsoft PowerShell Blog</a>. Next would be the man behind PowerShell, Microsoft Distinguished Engineer and  Lead Architect for the Windows Server Division – <a href="https://twitter.com/#!/jsnover" target="_blank">Jeffery Snover</a>, his enthusiasm for PowerShell and being more productive with automation is utterly infectious – he’s a really great speaker and I would highly recommend watching his talks (listed below). After Jeffery the next stop is <a href="http://www.leeholmes.com/blog/" target="_blank">Lee Holmes’ blog</a>. When you get stuck and start searching for help – chances are you’ll land on Joel Bennett’s <a href="http://huddledmasses.org/" target="_blank">Huddled Masses</a> blog – lots of great pragmatic content to be devoured there. Another great resource is the <a href="http://powershell.com/cs/">PowerShell Community Site</a>.</p>
<p><strong>Web Casts</strong></p>
<p>If you don’t have time to read books luckily Microsoft have put a lot of effort promoting PowerShell at their various conferences and via Channel9. I can’t recommend these talks highly enough – the topics are wide and varied – from using PowerShell to manage servers, to using PowerShell to create a management API over your applications – each of the talk shows how flexible PowerShell is and how productive you can be with it.</p>
<p><em>Channel 9</em></p>
<ul>
<li>Jeffrey Snover &amp; Bruce Payette  (2007) &#8211; <a href="http://channel9.msdn.com/Blogs/Charles/Windows-PowerShell-Origin-and-Future" target="_blank">Windows PowerShell: Origin and Future</a></li>
<li>Jeffrey Snover and Dmitry Sotnikov  (2007) &#8211; <a href="http://channel9.msdn.com/Blogs/Charles/Jeffrey-Snover-and-Dmitry-Sotnikov-Learn-and-Master-Windows-PowerShell-with-Quest-Softwares-PowerG" target="_blank">Learn and Master Windows PowerShell with Quest Software’s PowerGui</a></li>
<li>Expert to Expert (2008) &#8211; <a href="http://channel9.msdn.com/Shows/Going+Deep/Expert-to-Expert-Erik-Meijer-and-Jeffrey-Snover-Inside-PowerShell" target="_blank">Erik Meijer and Jeffrey Snover &#8211; Inside PowerShell</a></li>
</ul>
<p><em>PDC 2008</em></p>
<ul>
<li>Jeffrey Snover  &#8211; <a href="http://channel9.msdn.com/Events/PDC/PDC08/ES24" target="_blank">PowerShell: Creating Manageable Web Services</a></li>
</ul>
<p><em>PDC 2009</em></p>
<ul>
<li>Kenneth Hansen, Narayanan Lakshmanan &#8211; <a href="http://channel9.msdn.com/Events/PDC/PDC09/SVR12" target="_blank">Building Your Administration GUI over Windows PowerShell</a> &amp; <a href="http://channel9.msdn.com/Events/PDC/PDC09/SVR13" target="_blank">Windows PowerShell: An Automation Toolbox for Building Solutions That Span Small Businesses, Enterprises, and Cloud Services</a></li>
</ul>
<p><em>Tech-Ed 2010</em></p>
<ul>
<li>Mir Rosenberg, Refaat Issa &#8211; <a href="http://channel9.msdn.com/Events/TechEd/NorthAmerica/2010/WSV401" target="_blank">Advanced Automation Using Windows PowerShell 2.0</a></li>
<li>Jeffery Hicks &#8211; <a href="http://channel9.msdn.com/Events/TechEd/NorthAmerica/2010/WCL313" target="_blank">Paradigm Shift: Microsoft Visual Basic Scripting Edition to Windows PowerShell</a></li>
<li>Phil Pennington, Don Jones  &#8211; <a href="http://channel9.msdn.com/Events/TechEd/NorthAmerica/2010/WSV319" target="_blank">Manage Your Enterprise from a Single Seat: Windows PowerShell Remoting</a></li>
<li>Don Jones &#8211; <a href="http://channel9.msdn.com/Events/TechEd/NorthAmerica/2010/WCL308" target="_blank">Inventory Your Network and Clients with Windows PowerShell</a></li>
</ul>
<p><em>Build 2011</em></p>
<ul>
<li>Andrew Mason &amp; Jeffery Snover &#8211; <a href="http://channel9.msdn.com/Events/BUILD/BUILD2011/SAC-416T" target="_blank">Windows Server 8 apps must run without a GUI &#8211; learn more now</a></li>
<li>Jeffrey Snover, Refaat Issa &#8211; <a href="http://channel9.msdn.com/Events/BUILD/BUILD2011/SAC-644T" target="_blank">Make your product manageable</a> &amp; <a href="http://channel9.msdn.com/Events/BUILD/BUILD2011/SAC-646T" target="_blank">Manage a highly-efficient environment at scale using the Windows Management Framework (WMF)</a></li>
<li>Christopher Palmer &#8211; <a href="http://channel9.msdn.com/Events/BUILD/BUILD2011/SAC-565T" target="_blank">Windows networking with PowerShell: A foundation for data center management</a></li>
</ul>
<p><em>Tech-Ed 2011</em></p>
<ul>
<li>Dean Corcoran &#8211; <a href="http://channel9.msdn.com/Events/TechEd/Australia/Tech-Ed-Australia-2011/SVR309" target="_blank">PowerShell Above and Beyond: GUIs, Workflows, and More</a></li>
<li>Don Jones &#8211; <a href="http://channel9.msdn.com/Events/TechEd/NorthAmerica/2011/WCL321" target="_blank">Windows PowerShell Remoting: Definitely NOT Just for Servers</a></li>
<li>Dan Harman, Jeffrey Snover &#8211; <a href="http://channel9.msdn.com/Events/TechEd/NorthAmerica/2011/WSV406" target="_blank">Advanced Automation Using Windows PowerShell 2.0</a></li>
<li>Jeffery Hicks &#8211; <a href="http://channel9.msdn.com/Events/TechEd/NorthAmerica/2011/WSV322" target="_blank">Managing the Registry with Windows PowerShell 2.0</a></li>
<li>Jeffrey Snover &#8211; <a href="http://channel9.msdn.com/Events/TechEd/NorthAmerica/2011/WSV315" target="_blank">Windows PowerShell for Beginners</a></li>
</ul>
<p><strong>Writing testable scripts</strong></p>
<p>One of the most immature aspects of the PowerShell platform is writing tests for scripts – I’ve tried many of the frameworks that are out there – each has it’s own strengths and weaknesses – but the framework I’ve been using (with some success) of late is <a href="http://scottmuc.com/blog/development/pester-bdd-for-the-system-administrator/">Pester – a BDD style framework for PowerShell</a>, you can grab the code from the <a href="https://github.com/scottmuc/Pester">official GitHub Repository</a>.</p>
<p><strong>Tooling</strong></p>
<p>Lastly a word on tooling – even though Windows comes with PowerShell ISE (Integrated Scripting Environment) – I’ve found <a href="http://powergui.org">PowerGui</a> to be a much nicer environment to work in – the debugging support (which you will need) is far superior to ISE.</p>
<p>Remember: work smarter, not harder!</p>
<p>@<a href="http://twitter.com/HowardvRooijen">HowardvRooijen</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.endjin.com/2012/03/an-omega-geeks-guide-to-learning-powershell/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
