Get-Posh-Git | Test-Lab

Posts in this series

  1. Test-HomeLab -InputObject ‘The Plan’
  2. Get-Posh-Git | Test-Lab
  3. Get-DSCFramework | Test-Lab
  4. Invoke-DscBuild | Test-Lab
  5. Test-Lab | Update-GitHub

My instal test lab starting to take shape.

I have a vyos router bridging my production environment and my isolated virtual switch similar to what Greg Altman talks about on

And I have one Windows 8.1 Pro VM to setup the DSC tools

Now I’m going to get the development branch, as it has some major fixes, including a re-working of how modules are tested and package, and how passwords are stored.  The part on password is the big item for me.

Now I could just download it via GitHub using IE.

DevBranch  downloadzip

But this blog is about giving back to the community so I’m going to using the GitHub client, and it’s included Posh-Git module for PowerShell.

The GitHub client is a nice simple GUI client, but I have one issue with it. It installs into a users profile. While all store apps and downloaded .net apps do this and it’s a good thing for isolation. In a secure environment like where i work it’s frowned apon. So ifyour in that boat, Posh-Git can be downloaded from github and works with other git clients.

Now I dont plan on using the GUI for the purpose of this blog so I’m going to change my PowerShell profile to load posh-git. GitHub client has to be ran once to create the files I use in my profile.

The commands for that are.

 #create/add posh-git to profile
 if (-not (test-path (split-path -Path $profile.CurrentUserAllHosts -Parent)))
 mkdir (split-path -Path $profile.CurrentUserAllHosts -Parent)
 '. (Resolve-Path "$env:LOCALAPPDATA\GitHub\shell.ps1")' | out-file -Path $profile.CurrentUserAllHosts -Append
 '. $env:github_posh_git\profile.example.ps1' | out-file -Path $profile.CurrentUserAllHosts -Append

restart powershell and I can run get-module to see what modules are loaded.

C:\> Get-Module

ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Script    ISE                                 {Get-IseSnippet, Import-IseSnippet, New-IseSnippet}
Manifest    Microsoft.PowerShell.Management     {Add-Computer, Add-Content, Checkpoint-Computer, Clear-Content...}
Manifest    Microsoft.PowerShell.Utility        {Add-Member, Add-Type, Clear-Variable, Compare-Object...}
Script     0.0        posh-git                            {Add-SshKey, Enable-GitColors, Get-AliasPattern, Get-GitDirectory...}

Now we are ready to fork the DSC repository and clone it locally.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s