Monthly Archive


Monthly Archives: September 2013

iOS7–1 giant step–backwards

Just upgraded my ipad to iOS7 overnight.  It looks awful.  Like a child’s toy.  Apple may have been a triumph of style over substance in the past but they’ve lost any claim to style with this one.

Module versions in PowerShell 4.0

Comparing a Windows 8.1 build with a Windows 8 machine I think these modules remain the same between Windows 8/PowerShell 3 and Windows 8.1/PowerShell 4


While these modules appear to have changed – at least with the version number AppBackgroundTask AppLocker Appx AssignedAccess
1.0     Defender
2.0     Dism International Microsoft.PowerShell.Management Microsoft.PowerShell.Utility NetAdapter NetEventPacketCapture NetLbfo NetNat NetQos NetSecurity PcsvDevice
1.1     PrintManagement
1.0     PSDesiredStateConfiguration PSScheduledJob PSWorkflow SecureBoot SmbShare SmbWitness StartScreen Storage TLS TrustedPlatformModule VpnClient WindowsSearch

Some of these are new – look for the 1.0 version numbers. I’ll be working through the changes over the next few weeks.  More to come

Death of the command line?

I saw this today “the desktop is going to disappear, just like the command line before it” in


Has the guy never heard of PowerShell?

PowerShell Summit NA 2014

Public registration for next years PowerShell Summit is now open.

The 2013 summit was the PowerShell event of the year. Next years promises to be at east that good.

PowerShell help

There’s an announcement from the team producing PowerShell help that most of the help for PowerShell 4.0/Windows 8.1/Windows 2012 R2 is complete.

You can see the latest versions of the help files at


The version numbers may not be fully up to date but they will be corrected

The link is worth bookmarking for future use

PowerShell whimsy with arrays

I was thinking about the Christmas song – 12 days of Christmas and wondering just how many presents were delivered. Don’t ask why!

So I decided to work it out.

$days = 12
$presents = 1..$days

$total = 0
0..($days-1) | foreach {
  $total += $presents[$_] * $presents[(-1 * $presents[$_] )]

You start with 12 days & create an array containing the values 1 to 12

Set the total to 0 & loop through the days. Because array indices start at 0 you need the range 0-11 which you can calculate as 0..($days-1)

The total number of presents delivered of a type is the number of things 1 partridge, 2 turtle doves etc multiplied by the number of times its delivered 12, 11, 10 etc

The number of presents of a particular type is from the array $presents[$_]. The days delivered is found by getting an inverse relationship into the array.  So present 1 delivered 12 times which is value of last element; present 2 delivered 11 times which is next to last element etc.

Now the point of the post is to show you that you can access the last element of an array using an index of –1; the next to last using –2 and so on.

As we want to calculate this we end up with taking the value of the array for that point and multiplying by –1 to get the value we need fo r the multiplication 

$presents[(-1 * $presents[$_] )]


Add the calculated values together and you get the total number of presents delivered.

I’ve deliberately put more () into this than needed to make the logic easier to follow.

Windows 2012 activation

Following the nightmare of my last post – don’t what I was doing last night – it seems that Windows 2012 R2 will activate as soon as an internet connection is established.

If you attempt to manually activate (not noticing that its happened already) it will ask for a product. Still doesn’t appear to accept the key I’d already input during install which seems odd.

At least its working

Windows 2012 R2–ouch

The other day I downloaded Windows Server 2012 R2. Goodie I thought I’ll download that.  Download worked. Installed 2012 R2 in to a VM and started to configure it tonight. 

Went to activate Windows and it asked for a product key.  No biggie as I grabbed that during the download.

Entered the key and it was rejected.  Huh. Assumed a mistype and tried again. Still rejecting.  Went back to MSDN and got a second key. Rejected again.

Next steps – trash the VM & re-download & rebuild.

I do love doing things a second time for no apparent reason.

Windows 2012 R2 PowerShell Execution policy

In Windows 2012 R2 RTM – just installed first VM this evening – the PowerShell execution policy is set to RemoteSigned. One less thing to change when I create new VMs.

Loading the SQLPS module

Loading the SQLPS module gives you quick access to the sql cmdlets, sql provider and the SMO assemblies. It also, infuriatingly, moves your location into the sql provider.

I (really) *  (lots ) hate things that assume what I want to do.

You can use PowerShell to reverse this annoying, and arrogant action:


Import-Module SQLPS


Will get you back where you were.

SQLPS is slowly becoming a civilised member of the PowerShell eco-system especially when compared to its first incarnation.  A few more versions and it might behave properly.