Monthly Archive


Scripting Games September 2015

The puzzle for September is here


with the write up published here


Personally I don’t like the approach as it leads to code that’s difficult to read and maintain. I much prefer a simpler more verbose approach that is maintainable.

Windows PowerShell in Action, Third Edition

PowerShell in Action by Bruce Payette has been THE book for the PowerShell expert to learn how PowerShell works under the covers. If you  wanted to know how PowerShell works and why it works the way it does – this was the book.  PowerShell in Action second edition was written when PowerShell 2.0 was the new kid on the block but we’ve had PowerShell 3.0, 4.0 and now 5.0 since the book was written


Many people have asked if a new edition was going to happen.


The answer is yes and chapters 1 and 3 are now available through the Manning Early Access Program (MEAP).  It’s being completely revised with all text brought up to date for PowerShell 5.0 and new material covering all of the new features in PowerShell 3.0, 4.0 and 5.0 including Workflows, Desired State Configuration, PowerShell classes, programming APIs and more.


The MEAP is available from


If you want to know how PowerShell really works this is the book you need. I’ve used the first and second editions for many years and its always been the book I’ve turned to when I’m stuck. I’m honoured to be helping Bruce produce the third edition of this book and hope you get as much out of it as we’ve put into it.


Quick update check

Want to check on any updates that haven’t been fully applied in your environment.


Run this on your WSUS server (2012 R2)

£> Get-WsusUpdate -Classification All -Status Any -Approval AnyExceptDeclined |
where InstalledOrNotApplicablePercentage -ne 100


You can modify the filters:


Classification = one of All, Critical, Security, WSUS


Status = one of NoStatus, InstalledOrNotApplicable, InstalledOrNotApplicableOrNoStatus, Failed, Needed, FailedOrNeeded, Any


Approval = one of Approved, Unapproved, AnyExceptDeclined, Declined

PowerShell and DevOps Global Summit–call for topics extended

The call for topics for the PowerShell and DevOps Global Summit (renamed PowerShell Summit) has been extended.


If you’re thinking of submitting please do so.


If you want some ideas fro topics we’ll consider – see

Where next?

With the demise of the European PowerShell Summit organised by what should happen next in Europe as far as a PowerShell conferences are concerned?


The probability is that there will be a number of regional conferences. Tobias already has a German language conference and people at the Stockholm Summit were talking about an event based in Scandinavia.


What about the UK?


I been talking to a number people and ideas are beginning to coalesce.


Suggestions so far include a one day PowerShell Saturday and a PowerShell conference modelled on the recent Summits.

What do you want to see?


Its no use putting events together if its not what the UK PowerShell community actually wants.


Leave a comment if you have views for or against either of the two ideas and if you have another option please let me know

Scripting Games–August 2015

The August 2015 Scripting Games puzzle was a simple ‘get data from a web service’ request. You had to retrieve data from a given web service

£> Invoke-RestMethod -Uri '' |
Select-Object -Property  longitude, latitude, continent_code, timezone

longitude latitude continent_code timezone    
--------- -------- -------------- --------    
    -0.13     51.5 EU             Europe/London

Apart from the inaccuracy in the continent information – England isn’t part of Europe Smile - its pretty straight forward. The trick is remembering that Invoke-RestMethod exists and selecting out the properties you need.


If you wanted to productionise this you end up with the follwoing function as a minimum


function Get-GeoInformation
    param (
        [Parameter(Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)]
        [Alias('ip', 'address')]
        [ValidateScript({([System.Net.IPAddress]::TryParse($_, [ref]'')) -eq $true})]
    BEGIN {} #end begin
        try {
            if ($ipaddress) {
                foreach ($ip in $ipaddress){
                    if ($psCmdlet.ShouldProcess("$ip", 'Retreiving geo-location data')) {
                        Write-Verbose -Message "Retrieving data for $ip"
                        Invoke-RestMethod -Method GET -Uri "$ip" -ErrorAction Stop
                } # end foreach ($ip in $ipaddress)
            } # end if ($ipaddress)
            else {
                Write-Verbose -Message 'Retrieving data'
                if ($psCmdlet.ShouldProcess('default ip address', 'Retreiving geo-location data')) {
                    Invoke-RestMethod -Uri ''-ErrorAction Stop
            } #end else
        } # end try
        catch [System.Net.WebCmdletWebResponseException] {
            throw 'Error connecting to web service'
        catch {
            throw 'Unresolved error'

        } # end catch
    } #end process
    END {} # end end

            Get-GeoInformation returns data from the geoip web service

            Get-GeoInformation returns data from the geoip web service

            If an IP address is presented to the function that will be sent to
            the web service otherwise the current public IP address of the user,
            or their ISP, is used.

            .PARAMETER  ipaddress
            IP address to be tested. The IP address will be validated on input
            and an error thrown if invalid

            £> Get-GeoInformation

            longitude      : -0.13
            latitude       : 51.5
            asn            : AS9105
            offset         : 1
            ip             :
            area_code      : 0
            continent_code : EU
            dma_code       : 0
            timezone       : Europe/London
            country_code   : GB
            isp            : Tiscali UK
            country        : United Kingdom
            country_code3  : GBR

            No IP address is presented so the user's public (ISP address) is used

            £> Get-GeoInformation -ipaddress

            longitude      : -0.13
            latitude       : 51.5
            asn            : AS9105
            offset         : 1
            ip             :
            area_code      : 0
            continent_code : EU
            dma_code       : 0
            timezone       : Europe/London
            country_code   : GB
            isp            : Tiscali UK
            country        : United Kingdom
            country_code3  : GBR

            An IP address is used

            Written in response to the August 2015 Scripting Games puzzle




The function takes one, or more, IP addresses as an optional parameter and after testing its a valid IP address proceeds to call the web service for each IP address.


The –Confirm and –WhatIf parameters are available on the function via the  CmdletBinding:



I’ve also added comment based help.


Its interesting that a single PowerShell pipeline goes to over 100 lines of code when you add in the validation, error handling and other aspects of producing production code

PowerShell Summit Europe 2015 final schedule

The schedule for the PowerShell Summit Europe 2015 has been finalised.  See the event site at

WinOps conference

The WinOps conference will take place 22 September 2015 in London.


Details from


Its all about “Windows in a DevOps world”

PowerShell Summit NA 2016 – Call for Topics

The PowerShell Summit is the number one conference where PowerShell enthusiasts gather and learn from each other in fast-paced, knowledge packed presentations. PowerShell experts from all over the world including MVP’s, Guru’s, community leaders and PowerShell team members, will once again join together for a few days in Bellevue, WA. to discuss and learn about maximizing PowerShell in the workplace. If you want to share your PowerShell expertise or story, then this is your official call to submit presentations for selection!


PowerShell Summit North America 2016 will be held 4-6 April in the Meydenbauer center, Bellevue WA.

Topic Areas – What we are looking for

We are looking for 45-minute presentations covering a wide aspect of PowerShell expertise. We have two main topic areas that may assist you in building an abstract.

PowerShell Internals – A deep look into the inside workings of PowerShell and practical solutions that are built from them. These presentations are typically more directed to the PowerShell development community that is building extensions and solutions relating to PowerShell.

PowerShell Features Deep Dive – These presentations are a deep look into configuring and working with PowerShell features and capabilities such as Remoting, Desired State Configuration and more. These presentations tend to be more IT Pro focused.


We are open to presentations across the entire ecosystem that has been built around PowerShell; so don’t hesitate to send an abstract for your particular area of expertise. This includes Microsoft platforms and products that have PowerShell-based management tools as well as 3rd parties such as VMware. New topics will be preferred over recycling of older topics – look to see what’s new in PowerShell 5.0 and use the questions on to spot areas of confusion that could supply a good session for the Summit.

We may consider double length sessions, but only in exceptional cases. Please contact us – – with your idea before spending too much time developing such a session.

What kind of sessions get selected?

We’re looking for sessions that go beyond – way beyond – “beginner.” If you want to see examples of the depth we’re looking for use the recordings on the Youtube channel from the PowerShell Summit Europe 2014, or PowerShell Summit NA 2015 as a guide. We look for an abstract that’s compelling and makes us salivate to see your session – so spend time writing a punchy abstract! We want sessions that offer real-world usability combined with “wow, nobody talks about THAT” awesomeness. If in doubt aim high, very high. Remember, Summit sessions are recorded, so if you’ve previously presented a topic at a Summit, we’re less likely to choose it for another Summit. We want sessions that are challenging, and that ideally present things that simply aren’t explained or documented elsewhere. New modules, new techniques, and crazy approaches are all welcome. Discussion-format sessions are great, too, especially if you plan to turn them into a community deliverable (like a “best practices for writing DSC Resources” session that gets turned into a free e-guide later). Think community, deep dive, engaging, and amazing as keywords. We want attendees to finish each day with information leaking… just a little bit… out their eyeballs. Help us make it happen.

If you have any doubts about the suitability of a particular session please contact us - – we’re always happy to discuss proposed sessions.


We do have some goals for speaker selection, too. We obviously have, and appreciate, the great involvement we get from the product team. We aim to have a certain number of sessions from well-known members of the community, simply because they’re well-known for a reason – they do a great job! But we also set aside slots for newcomers who’ve never presented before, or who’ve maybe only presented once or twice before – the audience will judge you on content not style. We want to create opportunities for more folks to become engaged and active in our community, and the Summit is a great way to do that.


We aren’t looking for soft-skills sessions, like “how to get a new user group running,” although contact us via email ( if you’d like to do something like that as an extra evening thing after the main content wraps for the day.

Please note all sessions are to be delivered in English. Presenter will provide all equipment needed to deliver session(s), including a laptop or other computer. Presenter must be able to provide video by means of HDMI, DVI-D, or DisplayPort connectors – VGA is NOT supported. Presenter must be able to manually select an appropriate screen resolution for video output. Typically, 1024×768 or 1280×720 are preferred.

How to submit abstracts of presentations

Presentations will be 45-minutes in length and the submission should include the following:

Presentation Title

Presentation abstract – a description of the presentation and the topics covered. 250 words or less and suitable for marketing.


Go to


This is the only valid URL for pre-registration. Provide your e-mail address, password, and confirm password. You’re creating a new account, even if you’ve attended past Summit events.



Click Abstracts on the top menu


Enter Title and Description.



Provide a title and description; descriptions must be 50-250 words. Set the Status to “Ready to Review” when you are ready to send your session to us for consideration.


To return to the site at a later time, go to

Click Log In. You can then re-visit Abstracts.


Note that you must set your abstract status to Ready for Review or we won’t see it. If you leave it in Pending, it won’t be considered.

You can submit multiple presentations in the same topic area or for different ones. Be aware that even though the session length is 45 minutes we prefer to have at least 10 minutes set aside for questions. Summit presentations are intense and intimate often with plenty of audience interaction. You must expect questions and discussions. This is not a “lecture to the audience” event. Also because of the session length, generally co-presenters are unnecessary, but that is not a requirement.

Presentation submission deadline – When you should send it by

Start sending your presentation submissions immediately! The selection committee will start selecting presentations as soon as they arrive so you don’t want to miss out. The last day we will accept presentation submissions will be Thursday 1 October 2015. This is a hard deadline – no sessions will be accepted after this date.

When you will know you’ve been selected

The selection committee will start reviewing submissions immediately and begin the selection process. You will be informed if one or more of your presentations have been selected and notified by Thursday 15 October 2015.


You will need to log back onto the event site and complete your registration with the code we will provide in the notification email. This will have to occur before 31 October 2015 so that we have a completed agenda in time for attendee registration.

Speakers, with accepted sessions, will be given free admission to the event, including attendance at all official Summit activities. However, AWPP membership is not included. Speakers may not bring guests to the day sessions or evening events. We have a limited budget, and the number of speakers selected will be partially governed by that budget.


Pre-registering does not guarantee you a place at the event. Pre-registration is until 1 October 2015. Final session selections will be made by 15 October 2015, and you will be notified of accepted/unaccepted sessions.


If at least two sessions are accepted, you will be asked to immediately make a reservation at our speaker hotel. You will be given our group code, and we will directly pay for up to 3 nights’ lodging. Any additional nights are your responsibility as are travel and other costs.

If any sessions are accepted, you will be asked to immediately complete your Summit registration using a free promotional code. If you do not complete your registration by 1 November 2015, then we will assume you do not wish to present and your sessions will be cancelled, and the slots offered to another speaker.


If no sessions are accepted, then your pre-registration will be deleted. Beginning 1 November 2015 and through 4 March 2016, you are welcome to create a new account and register as a standard attendee on a space-available basis.


The final agenda will be announced and posted on PowerShell.Org on, or about, Sunday 1 November 2015.


We look forward to your submissions and your help in making PowerShell Summit North America 2016 the most valuable IT/Dev conference of the year building on and surpassing the previous Summits!

PowerShell Summit NA 2016–call for topics warning

A conference organiser’s work is never done. The dust has just settled from PowerShell Summit NA 2015 and we’re gearing up for PowerShell Europe 2015.


We also need to start thinking about PowerShell NA 2016! A post on


serves as a warning to start thinking about topics for PowerShell NA 2016 which will be in Bellevue (Seattle) again. The official call for topics will go out next week all being well.


Don’t worry about PowerShell Europe 2016 – we haven’t forgotten about that – the call for topics will occur towards the end of the year.