Saturday, August 30, 2014

Documentation–documenting variables in a script/function

A few weeks ago, I gave a PowerShell course during which the issue of documentation came up. The point I made was documentation is a good thing – and the more the better. The delegates really liked the comment based help approach. But it often does not go quite far enough.

One additional thing you can do is to document individual variables. Each variable object lives in the Variable: drive. Variables are , like everything PowerShell, an object. When you get child items of a variable, the variable is returned of the type System.Management.Automation.PSVariable. There are some special PowerShell variables (QuestionMarkVariable, LocalVariable, SessionStateCapacityVariable, and NullVariable). All of these objects have a Description property which enables you to describe each variable.

So you could do this:

$I = ‘’
(dir variable:I).description  = ‘the new IP address for the new server’
$iold = ‘’
(dir variable:iold).description  = ‘the new IP address for the new server’
Dir Variable: | Format-Table name,description –a

I’ve not used this approach much, but I probably do so in the future for production scripts at least!

Friday, August 29, 2014

Desired State Configuration Resource Kit–Wave 6

The PowerShell team has just released an update to the DSC resource kit – bringing the total number of DSC resources to over 80! While the bulk of the resources in the resource kit are ‘experimental’ – they seem to me to be very stable (continuing the PowerShell team’s ability to ship rich, useful, and reliable beta code).

And even better, the PowerShell team seem to have gone back to their old roots in terms of time to market. They appear to be releasing as they develop (and long may this continue). Thus, the new SafeHarbor DSC resource, this was finished after Wave 5 was released but before Wave 6 was ready so the PowerShell team published it separately, then publish it (with updates and bug fixes) a few weeks later in the Wave 6 drop. I can’t tell you how good this feels after so long under the cone of silence.

This latest drop has some very interesting resources, including the xChrome and xFirefox resources that help to deploy these two browsers. The Group resource shipped with PowerShell 4 is updated to provide support for cross-domain account lookups as well as for UPN-formatted names. The new xRemoteDesktopAdmin resource enables. Additionally, Wave 6 has a number of bug fixes to earlier waves. Again – the ability to get these fixes quickly is both useful and much appreciated. 

The  DSC story is slowly coming clearer with both the July drop and these continuingly improving resources. And with Chef integrating with DSC, DSC’s future looks very rosy.  If you are looking to find out a bit more about DSC – I’ll be covering the basics on the PowerShell PowerCamp event in October.

Synchtoy–a free utility from Microsoft

I just stumbled across an interesting utility, called SyncToy. Version 2.1 of this tool is available, free, from Microsoft at: This is the latest version of this tool, which was first published in 2009, so it’s not really new.

This highly customisable tool synchronises files and folders between file locations, kind of like a robocopy designed just to synch your files between two locations. You could use this to sync files such as photos, music files etc. with other computers. This might be easier than worrying about backup for these files.

To find out more about Synchtoy, or to ask questions – see the synch toy forum at: Tags:

Tuesday, August 26, 2014

PowerShell V5 July 2014 Preview

As promised by Jeffrey Snover at TechEd US, Microsoft has released a new and updated pre-release version of PowerShell V5. Oddly, I can’t find too many references to it, but here is where you can get the preview:

Note that these versions only install on Windows 8.1 and Server 2012 R2. My main workstation runs Windows Server 2008 R2 and while I know it needs upgrading, I am dreading the upgrade. For now, I’m running this update on just my laptop. Sadly – as this update has a lot of new features.

The new features, described in more detail in the release notes, include:

  • Generation of Cmdlets based on an Odata Endpoint - Export-ODataEndpointProxy is a cmdlet that will generate a set of Windows PowerShell cmdlets based on the functionality exposed by a given OData Endpoint. This feature is still not quote complete as it’s still under development – but this looks a great idea to open up OData to wider use.
  • Manage .ZIP files with new cmdlets – finally two new cmdlets to manage zip files: Compress-Archive creates a new zip file while Expand-Archive allows un-zipping. At long last!
  • DSC authoring improvements in Windows PowerShell ISE. Several new features are added to the ISE to simplify authoring of DSC resources, including the ability to list all the DSC resources within a configuration block (use Ctrl+Space) and lots of improvements to autocomplete/tab complete.
  • Changes in how the DSC Local Configuration Manager is installed.
  • Partial DSC configurations – this, for me, was a missing piece to DSC. Partial DSC Configuration enables you to deliver configuration documents to a node in fragments. This is, for me, a great simplification in how you deploy DSC configurations.
  • Cross-Computer Synchronisation – this improves the built in WaitFor DSC resources. This is highly important for complex multi-node configuration scenarios where you need to sync several systems in order to properly configure them.
  • New DSC cmdlets – there are several new cmdlets, including Get-DSCConfigurationStatus, Compare-DNSConfiguration, Publish-DSCConfiguration and Update-DSCConfiguration.
  • The new Detailed Script Tracing feature enables detailed tracking and analysis of Windows PowerShell scripting use on a system. After you enable detailed script tracing, Windows PowerShell logs all script blocks to the ETW event log, Microsoft-Windows-PowerShell/Operational. If a script block creates another script block (for example, a script that calls the Invoke-Expression cmdlet on a string), that resulting script block is logged as well. I can see this being very, very useful!
  • The *-item cmdlets are extended to enable creation of symbolic links. Yet another cmd.exe feature now with PowerShell parity. YEAH!
  • And of course the latest WMF includes the cool features added to earlier versions, including OneGet, PowerShell Get, Network Switch management

PowerShell V5 is shaping up to be a pretty significant release, with a slew of really cool and, IMHO, important new features. I just hope there will be a version of PowerShell V5 for Windows 7/Server 2008 R2 so I can avoid the OS upgrade on my primary workstation.

Once I have this new update installed on my laptop, I’ll provide some additional feedback. I am looking forward already not only to playing with this new release, but in seeing what else Redmond and the PowerShell team have up their sleeves. Tags: ,

Thursday, July 10, 2014

Satya Speaks–Towards a new Microsoft

I’ve been sitting in the garden, my Windows phone in my pocket, and browsing the web on my Surface RT. where I read with great interest Satya Nadella’s recent mail to Microsoft Employees. Microsoft kindly posted this email this morning at Not only a smart move making the email before Mary Jo managed to get a leaked copy, but the contents are very exciting.

I opined a bit over a year ago that Microsoft needed new management. A view that did me no favors in parts of Redmond. The whole devices, phones and games vs. Azure vs. the ‘what keeps Microsoft afloat (Windows, Office, SQL, Exchange, Lync)’ was simply confusing. And the Cone Of Silence imposed by folks no longer at Microsoft was leading to a very closed culture which IMHO was not helpful for the customer.

But things have changed and that Cone of Silence seems to be a thing of the past. Jeffrey Snover noted at TechEd, The PowerShell team at least is back to working in Internet time as two new exciting builds of PowerShell V5 the team pumped out this year so far.

In July last year, Steve Ballmer set out a new direction, devices and services. That there was a new direction was a really good thing, as was Microsoft’s overarching goal of One Microsoft. And his departure and replacement with Satya was another major change. To me, he’s more than just a safe pair of hands!

But there was still confusion – why lead with the two areas Microsoft has been weak with (consider the relative success of Zune, Kin, Surface RT, BPOS, to name but a few) when the cash cows and technological leaders (Windows and Office) were put in a distant second place.  Satya notes that the ‘devices and services’ description was useful as a start, there is a need to hone on on a more detailed strategy (which is not so devices and services focused).

Today’s mail calls Microsoft ‘the productivity and platform company for the mobile-first and cloud-first world.’ To me this makes a log of sense and eliminates some of the confusion. It puts the platform in it’s place as just that, a platform. A platform to empower productivity. This approach seems to me to make a lot of sense. But as ever the devil is in the detail – Satya notes there is quite a lot of work to be done that will require nothing less than a complete transformation of Microsoft the company. That is a tall order, but the strategy sure seems sound.

The email also talks about the ‘Device OS.’ Which one is that going to be will be an interesting question for resolution. I personally love my Surface 1 RT. I use it daily as a device for consumption of content and some limited creation. Then there’s the Phone OS (I have Windows Phone 8.) It, too, has it’s moments. Finally, there is the traditional Windows as running on the Surface Pro and higher pc/server SKUs running on higher performance hardware. My use of traditional Windows is limited to my desktop and laptop, where I can type a whole lot faster than on the phone (and arguably more accurately). I think we have some interesting changes to the core product roadmap and I am looking forward to that being shared.

Microsoft is changing, and in a good way. The next couple of years is going to be very interesting. The Chinese curse: may you live in interesting times seems to have come home to roost! I look forward to the coming year. Tags:

Monday, July 07, 2014

PowerShell PowerCamp–October 18-19th 2014

What is A PowerShell PowerCamp?
PowerCamp is a fast paced weekend training event that covers all the basic aspects of Windows PowerShell v5 - from the command line to writing production-oriented scripts and leveraging work flow and desired state configuration. We start with the basics including configuration, formatting and providers and remoting and jobs. Then, on day 2, we look at scripting, work flows, managing script libraries using modules, WMI/CIM,  using objects, and PowerShell in Windows. The event concludes with a look at the new Desired State Configuration feature in PowerShell 4 and 5.
The PowerCamp event is a combination of lecture, demonstrations plus Q&A, with the opportunity to type along with the tutor. There are no formal labs. But I do provide the key demos, all the slides, plus a wealth of other add on material on a memory stick you get at the start of day 1. So bring along your laptop, and type away.
What is the Agenda?
The event happens over the Weekend of October 18th and 19th. We start each day promptly at 9:00 and finish no later than 17:00.
Day 1 – The Basics
  • PowerShell Fundamentals – starting with the key elements of PowerShell (Cmdlets, Objects and the Pipeline) plus installation, setup, and profiles
  • What’s new in v5 – this looks at the things specifically added into PowerShell v5.
  • Formatting – how to format output nicely – both by default and using hash tables and display XML
  • Providers – getting into underlying OS data stores (certificate store, AD, registry, etc.) via providers
  • Remoting– working with remote systems using PowerShell’s remoting capabilities

Day 2 – Diving Deeper
  • Scripting Concepts – automating everyday tasks including PowerShell’s language constructs, error handling and debugging and workflows
  • Modules – managing PowerShell script libraries in the enterprise
  • Using .Net, COM, WMI and CIM objects – working with various kinds of objects
  • PowerShell in Windows – a look at what’s there and how you can leverage the huge number of cmdlets
  • PowerShell Desired State Configuration – this final module looks at PowerShell’s Desired State Configuration tool and what you can do with it.
What does it cost?
The cost is £200 (+VAT at the prevailing rate) for the weekend. Meals and accommodation are not covered.
Where is the event going to take place?
The PowerShell PowerCamp is being held at Microsoft Cardinal Place, 100 Victoria Street in Victoria. We will hold it on the weekend of October 18/19 2014. Each day starts promptly at 09:00 and finishes up by 16:45. We’ll also take short break throughout the day, including a 1-hour lunch break
PowerDrinks? After Saturday’s session, attendees are invited to a small nearby public house for some lovely English ale and networking with each other!
Who is the tutor?
The PowerShell Weekend PowerCamp is delivered by Thomas Lee. Thomas has been involved in the PowerShell community since the very beginning. He provides training and consultancy around a range of Microsoft products, with a recent focus on PowerShell and Lync Server. Thomas runs PowerShell training courses around the world, and has been a speaker at conferences across the world for the past decade. In his spare time, he lives with his wife, daughter, wine cellar, and Grateful Dead live recordings archive in a small cottage in the English countryside. His Twitter handle is @DoctorDNS and he maintains two blogs (Under the Stairs at and PowerShell Scripts Blog at
What do I need to bring?
You need to bring a laptop with PowerShell v5 loaded. That can be either native or in a virtual machine. I suggest you have at least two VMs pre-configured – one a server 2012 R2 installation the other a Windows 8 ,1installation. The virtualisation software is not of concern – but you need 64-bit guest OS support for Server 2012! Thus you can use Hyper-V, VMware Workstation or Oracle’s Virtual Box. Heck, run it in a VM on a Mac or Linux PC if you want. Just bring along PowerShell v3/4/5 (preferably V5!).
How do I book?
Contact to book a place and to arrange for the invoice to be paid. Payment must be in cash, cheque or bank transfer – I don’t take credit cards.
More Details
Watch this blog for any hot breaking news on the event.

Tuesday, July 01, 2014

PowerShell ISE Keyboard Shortcuts

I hit a recent issue using the ISE and trying to use the updated version of James Brundage’s ISEPackv2 module – a keyboard shortcut used in James’s module has been taken by a later version of PowerShell. Not the end of the world and easily remedied (heck, I have the code!). I was playing around with keyboard shortcuts and wrote a little function that, when run inside the ISE, gets the keyboard shortcuts that are set.
I’ve published the Get-ISEShortcut over on my PowerShell scripts blog, but the core of function is these lines of code:
$gps = $psISE.GetType().Assembly
$rm = New-Object System.Resources.ResourceManager GuiStrings,$gps
$rm.GetResourceSet((Get-Culture),$True,$True) |
    Where Value -CMatch "(F\d)|(Shift\+)|(Alt\+)|(Ctrl\+)"
This code gets the GUI related resource strings held by the ISE and then weeds out all but he keyboard shortcuts. In the published script, I sort them to get a more effective list. On my system, I get the following:
PSH [C:\foo]: Get-ISEShortcut | ft -AutoSize value, name
Value               Name                                          
-----               ----                                          
Alt+Backspace       EditorUndoShortcut2                           
Alt+Down            EditorSelectNextSiblingShortcut               
Alt+F4              ExitShortcut                                  
Alt+Left            EditorSelectEnclosingShortcut                 
Alt+Right           EditorSelectFirstChildShortcut                
Alt+Shift+Backspace EditorRedoShortcut2                           
Alt+Shift+Down      EditorBoxSelectLineDownShortcut               
Alt+Shift+H         ToggleHorizontalAddOnPaneShortcut             
Alt+Shift+Left      EditorBoxSelectToPreviousCharacterShortcut    
Alt+Shift+Right     EditorBoxSelectToNextCharacterShortcut        
Alt+Shift+T         EditorTransposeLineShortcut                   
Alt+Shift+Up        EditorBoxSelectLineUpShortcut                 
Alt+Shift+V         ToggleVerticalAddOnPaneShortcut               
Alt+Up              EditorSelectPreviousSiblingShortcut           
Ctrl+1              ShowScriptPaneTopShortcut                     
Ctrl+2              ShowScriptPaneRightShortcut                   
Ctrl+3              ShowScriptPaneMaximizedShortcut               
Ctrl+A              EditorSelectAllShortcut                       
Ctrl+Add            ZoomIn1Shortcut                               
Ctrl+Alt+End        EditorMoveCurrentLineToBottomShortcut         
Ctrl+Alt+Home       EditorMoveCurrentLineToTopShortcut            
Ctrl+B              BreakAllDebuggerShortcut                      
Ctrl+Backspace      EditorDeleteWordToLeftShortcut                
Ctrl+Break          StopExecutionShortcut                         
Ctrl+C              StopAndCopyShortcut                           
Ctrl+D              GoToConsoleShortcut                           
Ctrl+Del            EditorDeleteWordToRightShortcut               
Ctrl+Down           EditorScrollDownAndMoveCaretIfNecessaryShortcut
Ctrl+End            EditorMoveToEndOfDocumentShortcut             
Ctrl+F              FindShortcut                                  
Ctrl+F1             ShowCommandShortcut                           
Ctrl+F4             CloseScriptShortcut                           
Ctrl+G              GoToLineShortcut                              
Ctrl+H              ReplaceShortcut                               
Ctrl+Home           EditorMoveToStartOfDocumentShortcut           
Ctrl+I              GoToEditorShortcut                            
Ctrl+Ins            Copy2Shortcut                                 
Ctrl+J              ShowSnippetShortcut                           
Ctrl+Left           EditorMoveToPreviousWordShortcut              
Ctrl+M              ToggleOutliningExpansionShortcut              
Ctrl+Minus          ZoomOut3Shortcut                              
Ctrl+N              NewScriptShortcut                             
Ctrl+O              OpenScriptShortcut                            
Ctrl+Oem6           GoToMatchShortcut                             
Ctrl+Plus           ZoomIn3Shortcut                               
Ctrl+R              ToggleScriptPaneShortcut                      
Ctrl+Right          EditorMoveToNextWordShortcut                  
Ctrl+S              SaveScriptShortcut                            
Ctrl+Shift+Add      ZoomIn2Shortcut                               
Ctrl+Shift+D        GetCallStackShortcut                          
Ctrl+Shift+End      EditorSelectToEndOfDocumentShortcut           
Ctrl+Shift+F9       RemoveAllBreakpointsShortcut                  
Ctrl+Shift+H        HideHorizontalAddOnToolShortcut               
Ctrl+Shift+Home     EditorSelectToStartOfDocumentShortcut         
Ctrl+Shift+L        ListBreakpointsShortcut                       
Ctrl+Shift+Left     EditorSelectToPreviousWordShortcut            
Ctrl+Shift+Minus    ZoomOut4Shortcut                              
Ctrl+Shift+P        StartPowerShellShortcut                       
Ctrl+Shift+Plus     ZoomIn4Shortcut                               
Ctrl+Shift+R        NewRemotePowerShellTabShortcut                
Ctrl+Shift+Right    EditorSelectToNextWordShortcut                
Ctrl+Shift+Subtract ZoomOut2Shortcut                              
Ctrl+Shift+U        EditorMakeUppercaseShortcut                   
Ctrl+Shift+V        HideVerticalAddOnToolShortcut                 
Ctrl+Space          IntellisenseShortcut                          
Ctrl+Subtract       ZoomOut1Shortcut                              
Ctrl+T              NewRunspaceShortcut                           
Ctrl+U              EditorMakeLowercaseShortcut                   
Ctrl+Up             EditorScrollUpAndMoveCaretIfNecessaryShortcut 
Ctrl+V              Paste1Shortcut                                
Ctrl+W              CloseRunspaceShortcut                         
Ctrl+X              Cut1Shortcut                                  
Ctrl+Y              EditorRedoShortcut1                           
Ctrl+Z              EditorUndoShortcut1                           
F1                  F1KeyboardDisplayName                         
F1                  HelpShortcut                                  
F10                 StepOverShortcut                              
F10                 F10KeyboardDisplayName                        
F11                 StepIntoShortcut                              
F11                 F11KeyboardDisplayName                        
F12                 F12KeyboardDisplayName                        
F2                  F2KeyboardDisplayName                         
F3                  F3KeyboardDisplayName                         
F3                  FindNextShortcut                              
F4                  F4KeyboardDisplayName                         
F5                  F5KeyboardDisplayName                         
F5                  RunScriptShortcut                             
F6                  F6KeyboardDisplayName                         
F7                  F7KeyboardDisplayName                         
F8                  F8KeyboardDisplayName                         
F8                  RunSelectionShortcut                          
F9                  F9KeyboardDisplayName                         
F9                  ToggleBreakpointShortcut                      
Shift+Backspace     EditorDeleteCharacterToLeftShortcut           
Shift+Del           Cut2Shortcut                                  
Shift+Down          EditorSelectLineDownShortcut                  
Shift+End           EditorSelectToEndOfLineShortcut               
Shift+Enter         EditorInsertNewLineShortcut                   
Shift+F11           StepOutShortcut                               
Shift+F3            FindPreviousShortcut                          
Shift+F5            StopDebuggerShortcut                          
Shift+Home          EditorSelectToStartOfLineShortcut             
Shift+Ins           Paste2Shortcut                                
Shift+Left          EditorSelectToPreviousCharacterShortcut       
Shift+PgDn          EditorSelectPageDownShortcut                  
Shift+PgUp          EditorSelectPageUpShortcut                    
Shift+Right         EditorSelectToNextCharacterShortcut           
Shift+Up            EditorSelectLineUpShortcut 

Thursday, June 05, 2014

PowerShell Samples in TechNet

When I first started getting into PowerShell, I browsed the TechNet and MSDN libraries to find samples that illustrated the use of various MS technologies. To get better at PowerShell, I then converted these MSDN/TechNet samples into PowerShell, posted them to the Microsoft site as well to my own blog site.

At the time I began doing this, there was a nice library page for both TechNet and MSDN which showed a tag cloud of the samples that had been tagged and a leader board showing who’d submitted the most updates. With the work noted above, I quickly took top spot – and slowly but surely created a huge gap between me and the next busiest contributors (at time I had contributed more content to the Technet site than the next 9 together). For reasons I’ve never been told, much of this was taken away – there is no leader board any more, the tag cloud(s) are gone and the ability to add community content is much diminished.

Having said that, today I noticed something that really made me happy. Real PowerShell samples in Technet.  If you look at the page, you see a bunch of tasks you can undertake using WMI. In the days gone by,  had added a bunch of samples here, recoding the VB script samples into PowerShell.  What surprised me is that all MY samples are gone, but: there are now proper PowerShell samples included in some of the samples. Look, for example at – which shows using the registry – you can now see the samples where they belong.

In converting my samples to integrated samples, Microsoft has removed the attribution and has made some silly errors. For example, on (on he first sample, $computer is defined but is not used for example). And someone has taken the attributes (like who wrote the sample) off.

It’s great to see samples using PowerShell being added into the TechNet library – long may this continue.

Technorati Tags: ,,,

Monday, May 19, 2014

SpiceWorld London 2014–A Wonderful Conference

Last week I had a wonderful opportunity to attend and speak at Spicework’s SpiceWorld London. It was a great 2-day event held at The Brewery, Chiswell Street in the city. I mentioned this event in my blog (see

The event itself was lovely – it was fairly small and intimate. This allowed time and space to meet other delegates and to talk to the exhibitors. The Exhibition was also pretty good – I got to talk to some great companies and picked up some great take-aways. Thanks especially to Acronis for a full copy of their software, which is really, really useful. And thanks to HP for the really nice phone charger – as it turns out, I needed it for the train ride home.

My talk was entitled Bringing Home The Bacon – an Introduction to Windows PowerShell. I’ve uploaded the slides to SlideShare ( and you are free to take a look. The talk is introductory to PowerShell, but I did spend time both in slides and in the talk making the case for PowerShell. I certainly persuaded many IT Pros to at least take a look, but there are always going to be some die hards who will only relinquish the GUI when it’s pried from their cold dead hands. I can see their point – although my view is simpler. There are two types of admin – those who just know the GUI and those who know the GUI and PowerShell. The latter are always going to be the ones making the bigger bucks.

One unique aspect of the event was the presence of all of the founders of Spiceworks, who were there both to talk to the attendees, but also to listen. I had several great conversations around the use of PowerShell in the SpiceWorks applications and how that might be achieved. It was utterly awesome to have a view (i.e. SpiceWorks needs a PowerShell interface) and have the very people who can deliver that there and listening. It was very refreshing.

Of course, any great conference had to have good parties and that was sure the case. The pre-party was held at a pub – which was just able to hold all the attendees. And the main party, held at The Vault, was pretty cool too, complete with a nice band.

I am looking forward to next year’s event already!

Friday, May 16, 2014

Updated PowerShell V5 Preview Released

The Microsoft PowerShell team has just released an updated beta version of PowerShell Version 5. To give the release it’s full title, it is known as: Windows Management Framework 5.0 Preview May 2014. This update comes only a month after a prior release – showing that the PowerShell team sure can turn things around fast!

This update is available on The update consists of three files – two install packages (one for X86, the other for X64) and a small set of release notes.

In order to install it you must be running the LATEST OSs  windows 8.1 or Server 2012 R2. According to the release notes, All versions of Windows 8.1 are supported, as are all versions of Server 2012 R2 (except Itanium [SIC as there IS no version of Server 2012 R2 for Itanium as per]). I continue to find it curious that these betas are not supported on Windows 8 and Windows 7 (and related server products). I suspect that this may be a testing issue – testing takes time and as we know, to ship is to chose. Doesn’t really matter for me as my main servers and my laptop are up to spec. If nothing else, this decision is pushing me to upgrade to Server 2012 R2 on my development workstation – but before I do that, I need more RAM and a new disk so it’s going to have to wait a few weeks.

Installing this is easy – just navigate to the  download site, get the download package and run it. Installing it on a Windows 8.1 system does not even require a reboot to do the install.

So what’s new?

Of course, there are bug fixes etc. – at least I expect so. But they aren’t mentioned. There are also included the same two big items in the first WMF preview: OneGet and the Network Switch cmdlets.

But the most exciting addition here is a new module: PowerShellGet. The Earlier WMF preview contained a module called OneGet, which helps you to find programs and packages in the external world. I used PSG to get me the Sysinternals tools, and a nice  XML/HTML basic editor called bluefish. 

PowerShellGet uses similar logic to find you new PowerShell modules. The module has just 4 cmdlets: Find-Module, Install-Module, Publish-Module, and Update-Module. Simple and elegant – and it works a real treat! It enables you to find modules, and then download and install them (and update them in due course).

The documentation does not really make clear where these modules come from, but with a bit of detective work, the modules are found and published from/to the PowerShell resource Gallery (

In order to use Find-module, you need an external program, Nuget.exe (but the first time you use Find-Module you are nicely prompted for it). Once you download this, Find-Module finds a total of 52 modules, including some neat ones like PowerShellIseModule, TCPServer, and LocalUserManagement to name but a few). To install new modules requires administration rights.

Using this module looks like imagethis:

This is a nice touch – and I will certainly be exploring more of these modules.

All in all, this is a nice update.And it’s going to give me more work to do, especially in the area of PowerShell get. DSC is the other aspect I need to dig more into – and finding the dsc resource modules gives me more incentive!

I can’t wait to see what comes next?


Monday, May 05, 2014

Lync Conference Sessions Now Available

Earlier this year, Micrososft held the Lync Conference in Las Vegas and recorded the sessions. These sessions are now available at:

Go for it!

Thursday, May 01, 2014

SpiceWorld London Speakers Announced

Spiceworks is a free network management, monitoring, helpdesk, pc inventory and reporting solution. Produced by Spiceworks. But Spiceworks also has a very active technical support set of forums, including ones for Windows, VOIP, and of course PowerShell.

I’ve been contributing to Spiceworks since last autumn and am enjoying the place. I find the community a lot more supportive and a little less whiney than some of the other support boards. the place is very welcoming to newbies which I find especially good.

Every year, Spiceworks has a conference, SpiceWorld, which is held both in the US and in London. The conference is aimed at helping folks use the SpiceWorks app but also to be even more awesome IT Pros. AND, one feature that gets a lot of attention is the swag – I’m told I should bring an extra suitcase. This year’s London SpiceWorld is being held at The Brewery in Chiswell street on May 13-14. See for the details.

Every year, one or two of the SpiceHeads (those of us active on the Spiceworks site) get asked to contribute. This year, it’s my turn and I’m going to be speaking about (ed: what else) PowerShell. My talk will be titled Bringing Home The Bacon With PowerShell with scripting and automation. It’s a short talk, I only have an hour, but I’ll be trying to cover the basics of PowerShell and looking more importantly at why every IT Pro should be keen to learn more.

I hope to see one or two of you there! Tags: ,

Tuesday, April 08, 2014

Windows XP–RIP

So, after years of anticipation, today is the day we say good bye to Windows XP. Today, XP has finallyi reached end of life (at least for most home and corporate users). The patches being released today are the last most users will ever see.

From today. XP is EOL. There will be no more patches, and from next month, patches released for Vista, Windows 7 and Windows 8.x will telegraph to the hackers where vulnerabilities in XP may lie.

Is it xxall gloom and doom? No – of course not. For some users, at least, Microsoft has agreed to continue supporting XP. The UK government recently announced such an extension although it came with a big price tag. And all those ATM systems that run XP are also given a bit of breathing space.

But what if you are a normal corporate user, or normal home user? Well, if all you do is just get email from GMAIL/ etc, and maybe do a bit of Skyping with the grandparents/grandkids, you will probably be fine. But if you go to a lot of sites, using IE, and have a habit of clicking on links you find in Twitter, Facebook, etc – your risk begins soon. I liken it to traveling to a country with active Polio, or other diseases without having your shots. Yes, you may be just fine – but you may also pick up a very nasty disease.

So what should you do? If you are a home user, you really should move off of XP. My personal  recommendation is to move to Windows 8.1. If the new UI is too much pain, then either use Windows 7, or just buy Start8 by Stardock to get you over the Modern blues. If you are a corporate customer still running XP, you need to get your IT department to upgrade.

I am certain that there are a lot of users, some who are reading this blog post, who haven’t moved and who may not move. After all XP works, doesn’t it? Why spend money needlessly? The reason, simply, is risk. The longer you wait to upgrade, the more time the hackers have to craft attacks.

I loved XP back in the day. The early beta versions were full of promise, and after SP2, we saw that promise turn into a great OS. But it has come to the end of life. Let it go and upgrade.

Friday, March 14, 2014

April 2014 PowerCamp Cancelled :-(

Sadly, I have to cancel the PowerCamp event scheduled for end April 2014. The event was scheduled to be held in Microsoft’s offices in London, but they have just informed me they are going to be carrying out maintenance on the building, This means we’ll have no air conditioning or power. Which makes it kind of impossible to run an event.

I am very sorry for those of you who have booked – I’ll organise a refund by the close of play today. I hope to run another event in the Autumn, and will announce it as soon as possible. Tags:

Wednesday, March 05, 2014

Announcing PowerShell PowerCamp–April 26-27 2014 in London

With the winter of rain, hopefully now well behind us, it’s time to look forward. Both Server 2012 R2 and Windows 8.1 now slowly pushing into organisations large and small the End of Life for Server 2003 and Windows XP are looming. Learning PowerShell is now, more than ever, something every IT Pro needs to do! While I say this ever year, it seems to me that learning PowerShell is now, more than ever, something every IT Pro needs to do! And one great way to get up to speed is via the PowerShell PowerCamp event!

Why Learn PowerShell?

I hear this question a lot – after all the GUI is so good, why bother with PowerShell? Well, for a start, PowerShell is now at the centre of Microsoft's manageability strategy. Every key component of Windows Server (and client for that matter) can be managed using PowerShell. The latest sets of cmdlets enable you do to more than ever before with PowerShell. At the end of the day, PowerShell provides reliable, robust and repeatable automation – and in these days of having to do more with less, that’s vital.

What is A PowerShell PowerCamp?
PowerCamp is a fast paced weekend training event that covers all the basic aspects of Windows PowerShell v4 - from the command line to writing production-oriented scripts. The focus is on smart IT Pros who know then need to learn PowerShell but can’t afford to take a week and take the standard Microsoft course. We package this up at a price that’s easily affordable.

On day 1, we start with the basics including configuration, formatting and providers, remoting and jobs. Then, on day 2, we look at scripting, work flows, managing script libraries using modules, WMI/CIM,  using objects, and finishing with the PowerShell features added into the latest versions of Windows.

The PowerCamp event is a combination of lecture, demonstrations plus Q&A, with the opportunity to type along with the tutor. There are no formal labs. But I do provide the key demos, all the slides, plus a wealth of other add on material on a memory stick you get at the start of day 1. So bring along your laptop, and type away. I use a set of VMs to demonstrate and you can bring along ones you made earlier so as to follow along as I demo.

What is the Agenda?
Day 1 – The Basics
• PowerShell Fundamentals – starting with the key elements of PowerShell (Cmdlets, Objects and the Pipeline) plus installation, setup, and profiles. I also call out some of the new features in PowerShell V4.
• Formatting – how to format output nicely – both by default and using hash tables and display XML
• Providers – getting into underlying OS data stores (certificate store, AD, registry, etc.) via providers
• Remoting and jobs– working with jobs plus working with remote systems using PowerShell’s remoting capabilities
Day 2 – Diving Deeper
• Scripting Concepts – automating everyday tasks including PowerShell’s language constructs, error handling and debugging and workflows
• Modules – managing PowerShell script libraries in the enterprise
• WMI and CIM – we look at the WMI and CIM components, including the new CIM cmdlets
• Using .NET and COM Objects – working with native objects
• PowerShell in Windows 2012 R2 and Windows 8.1 – a look at what’s there and how you can leverage the huge number of new cmdlets

And as we go, we always have time to take your questions and to show you how to overcome your issues with PowerShell!

What does it cost?
The cost is £200 (+VAT at the prevailing rate) for the weekend. Meals and accommodation are not covered. Should you book and have to cancel, that’s fine so long as you give at least two weeks notice – I understand that plans change. Refunds after that point are not, sadly, possible.

Where is the event going to take place?
The PowerShell PowerCamp is being held at Microsoft Cardinal Place, 100 Victoria Street in Victoria on the weekend of April 26/27 2014. Each day starts promptly at 09:00 and finishes up by 16:45. We’ll also take short breaks throughout the day, including a 1-hour lunch break.

After Saturday’s session, attendees are invited to a small nearby public house for some lovely English ale, etc. The first round is on me!

Who is the tutor?
The PowerShell Weekend PowerCamp is delivered by Thomas Lee. Thomas is a veteran PowerShell evangelist who has been involved in the PowerShell community since the very beginning. He provides training and consultancy around a range of Microsoft products, with a recent focus on PowerShell and Lync Server. In his spare time, he lives with his wife, daughter, wine cellar, and Grateful Dead live recordings collection in a small cottage in the English countryside. His Twitter handle is @DoctorDNS and he maintains two blogs (Under the Stairs at and PowerShell Scripts Blog at

What do I need to bring
You need to bring a laptop with PowerShell v4 loaded. That can be either native or in a virtual machine. I suggest you have at least two VMs pre-configured – one a server 2012 R2 installation the other a Windows 8.1 installation. The virtualisation software is not of concern – but you need 64-bit guest OS support for Server 2012 R2! Thus you can use Hyper-V, VMware Workstation or Oracle’s Virtual Box. Heck, run it in a VM on a Mac or Linux PC if you want. Just bring along PowerShell v4!

How do I book?
Contact to book a place and to arrange for the invoice to be paid. Payment must be in cash, cheque or bank transfer – I don’t take credit cards.

More Details
Watch this blog for any hot breaking news on the event.

Lync Server 2013 Virtualisation Whitepaper From Microsoft

Ever since Microsoft introduced Live Communications Server, customers have been asking how they can virtualize the product. During the OCS years, I constantly heard requests for support for Virtualisation. But the answer remained: no support. Eventually Microsoft did the work necessary to validate fully the product in a virtual environment. The result is that, today, you can fully virtualize both the Lync server and the Lync client product. But it’s not all that simple – virtualization just adds more opportunity for problems.

While many workloads are a great fit for virtualization, Lync is a real real-time application. As such, there can be performance related issues that are not even noticeable with other workloads. These issues manifest as poor audio and video resulting in a poor service to the user.

In a recently published White Paper, Lync Server 2013 Virtualization White Paper Microsoft provides full guidance for planning a Lync Server deployment in a virtual environment. The white paper descries how to configure Lync Server 2013 in a virtual environment, including both the host and the guest VMs. Also included are the most important Key Health Indicators (KHIs) that you should watch both when performing a capacity test prior to deploying, and later during deployment.

If you are planning a Lync deployment in a virtual environment or if you want to consider virtualizing part of your existing Lync infrastructure, you really should read this paper. Tags:

Tuesday, March 04, 2014

Lync and Windows Fabric

One of the major changes between Lync 2010 and Lync 2013 is the integration of Lync with Windows Fabric. Windows Fabric is described as ‘a Microsoft technology used for creating highly reliable, distributable an scalable applications’. Windows Fabric is designed to enable replication of application related data across multiple application servers. These application servers work in parallel to provide fault tolerance and scalability. Windows Fabric ensures the information needed for these applications is delivered reliably to each of the necessary servers.

Lync uses Windows Fabric to move information previously held in a back end database (and hence a bottleneck) to the front end servers. This eliminates the need for each Lync Front End server to use network resources to obtain application information – it’s available locally.

In the case of Lync, this change enables better scaling as well as providing resilience (a front end server can continue to work in the case of errors elsewhere in your network). While pretty much all of the complex stuff, with respect to Windows Fabric, is done auto-magically for you, it is important to understand what it’s doing, why and some of the issues arising.

One of key issues that arises from the integration of Windows Fabric and Lync is the recommendation of always having at least three ES servers in an ES pool. See for the details of this limitation.

For more information on the integration of Lync 2013 and Windows Fabric, see Richard Brynsteson’s post on the Mastering Lync blog. Tags: ,,

Monday, March 03, 2014

PowerShell Geek Week here we come

I’m off next week to Stockholm to deliver our sprig PowerShell Geek Week at LabCenter, Sweden’s top IT training firm. The idea of Geekweek is to both have fun and to learn more about PowerShell. Geekweek starts with a brief review of PowerShell – making sure you are fully up to speed with the fundamentals. Then we dive deep into the product showing you how you can leverage the power of PowerShell inside your organisations.

For more information about Geek Week – see the Lab Center page at And if you are going and you want any more information or want to ensure something is going to be covered, please feel free to ping me. Tags: ,

Missed the Lync Conference? Get the Sessions (using PowerShell)

Last week, Microsoft held their annual Lync Conference in Las Vegas. If you attended the conference, no doubt you missed some sessions – but all is not lost. If you were, like me, unable to go – all is not totally lost.

Superstar MVP Tom Arbuthnot has a script that will enable you to download all the sessions – PowerPoint's and videos. See Tom’s Blog for the PowerShell script to download sessions, along with some instructions on running it.

However: this script is currently only of use to attendees – those who did not attend will need to wait a while before Microsoft will release the material to a wider audience. As soon as I hear that this is available, I’ll blog it! Tags:

Friday, February 21, 2014

Lync Conference News

As I write this, Microsoft is running their annual Lync conference in Las Vegas. I would have liked to attend, but such is life. Up to about now, the news has been dribbling out, but UClarity a Swedish firm has summarised the first day’s news. You can read it here: but the content is in Swedish. Users of Chrome get offered a translation automatically, but if not, try going here:

Thursday, February 20, 2014

Lync now A Billion Dollar Business

Lync joins other Microsoft products in the billion dollar club! With the release of the Q4 earnings, Microsoft has disclosed that  is now taking in over one billion US$ and revenue grew 30% This is fantastic news to those of us watching in the Lync space.

As part of the earnings call, Microsoft also divulged that Skype delivered 162 billion call minutes this quarter. My wife calls her dad every day and they chat for an hour – so I know where a few hundred of those minutes come from – but 162 billion is a lot of call time. I suspect many telcos would love to have that call volume (well that volume in PAID calls anyway!).

Tom Arbuthnot has a few more comments about this over on his blog. It makes interesting reading. Tags:

Wednesday, February 19, 2014

News from the Lync Conference–Lync/Skype Video Chat interop Coming

It’s been a quiet week for Lync News as all the interesting stuff is happening at the Lync Conference in Las Vegas. One very interesting tit-bit is the news that Microsoft is aiming to deliver Lync/Skype video chat interoperability by the middle of this year. At long last!

Paul Thurrot has more information over on his WinSuperSite, including some good background to this announcement. You can read it here:

In that article, Paul also discloses that there will be a Lync application for Android tablets, although he did not name the date.


I am looking forward to hearing more of the news from Las Vegas and the Lync conference. I was hoping we’d also hear a bit more about the next version of Lync – but so far not much news. Tags:

Friday, February 07, 2014

Lync and How It Integrates with other MS Apps

One of the big changes with Lync has been Microsoft’s approach of investing in a particular product for a particular function/feature and then have other products leverage that investment. This really makes sense on two levels. First, product groups are not each re-inventing the same wheel. Second, it really makes the ‘better together’ argument more real and less hype.

For example, with Lync 2013, all contact information is in a single Unified Contact Store which is maintained by Exchange 2013. The architecture for that looks like this:


Microsoft has just published an awesome set of posters that illustrate all the current sets of feature integration along with loads of links and more information. I find this a fantastic Lync resource (if only the Microsoft Learning courses were as well described!

You can download these posters (it’s a 9 page PDF) from Tags: ,,

Thursday, February 06, 2014

Weekly round up of Lync and UC news - Lync Server 2013 Weekly

I have setup a Paper.Li weekly newsletter of news on UC and in particular Lync. You can see it: here. You can also subscribe (free) and get an abbreviated version in your mail box every Monday Morning. The mail can be clicked to get to the full content. The language is set to English, with coverage from around the globe. Tags:

Wednesday, February 05, 2014

Lync PreCall Diagnostics Tool

In Lync, and indeed with almost any VOIP product, call quality can vary. This variation can be caused by a number of factors, including network delay, jitter, packet loss, and under powered PCs. Diagnosing the causes is difficult if you don’t have all the facts.

Microsoft has issues a pair of new tools< PreCall Diagnostics Tool, that run on Win 7 (desktop) and Win 8 (as a metro/modern app). You can get the Desktop application here, and the modern app here.

To understand more about the tool(s) and what the out means, take a look at an excellent blog article by Byron Spurlock. Tags:

Tuesday, February 04, 2014

A Conference Call in Real Life

Thanks to Jamie Stark, there’s a very funny video looking at how Conference Calls work. It’s amusing but reminds me all too much of the conference calls I am on of late!

See the video on YouTube at:


A conference call in real life Tags:

Monday, February 03, 2014

IPv6 Essentials Webinar–Tue Feb 4 and Web Feb 5 2014

Tomorrow (Feb 5th 2014), GoGo6, an IPv6 company, is running a fee webinar with Alvaro Vives: IP v6 Essentials. You can go to their web site and sign up for the webinar which begins at 19:00 CET/18:00 GMT and 13:00 EST. It’s also being repeated later in the day on Feb 5 (you can sign up for both at the same place!

Why bother, you may be asking yourself? Great question and hopefully Arlindo will nail that answer as he looks at why IPv6 is a must, and how to address the issues that arise if you want to deploy IPv6.

While IPv4 is how most users deploy tools such as Lync Server, you can use IPv6. And at some time, I believe, IT pros will look back and wonder why anyone would want to use IPv4.

See you there!

Testing out Emergency Calling with Lync

Microsoft’s Lync server has a great feature called E911 – Emergency calling mainly for the UK and Canada. I teach Lync and find this topic to be of only minor interest in the UK and Europe mainly because we do not have E911 service over here (yet, anyway!).

Gary Williams has just published a great blog article entitled Is it OK to Place a Test Call to Emergency Services. His answer is Yes and he goes about telling how to do it. I have to say, I’ve always been quite nervous about testing out calls to 999 – and have only twice every had to call it for real.

But Gary’s article makes it clear that yes you can do this and also makes the good point that not testing it can be life threatening if it doesn’t work. He sets out how to do it in the article and it’s pretty simple. Gary also notes another potential gotcha – Lync will add a leading “+” to the number (e.g. if you dial 999, Lync ‘dials’ +999). Thus it’s vital that you have your routes are set up expecting this.

Technorati Tags: ,

Friday, January 31, 2014

Another Lync Add-on–SuperToast

I just love how the market is creating little useful add-ins to increases the functionality and value of Lync. The most recent one I’ve found is a product called SuperToast. It’s made by Modality Systems and you can read about it over on Modality’s web site.

SuperToast is a Lync application that notifies a Lync user of any missed instant messages and telephone or video calls. If an instant message is not acknowledged within a certain timeframe, or a call goes unanswered, SuperToast pops up a window in the centre of your screen, notifying you of any missed items. It stays there until you click it away and add any subsequent missed IM’s or calls to the list.

The value here should be obvious. For all too many IT Pros, and Information Workers, it is all too easy to miss an incoming instant message or call from a colleague, partner or even a customer. Combine that with the difficulty of being able to see when or what IM’s and calls you have missed. SuperToast avoids important queries going unnoticed.

Thursday, January 30, 2014

Access to PowerShellCookBook.Com

That very nice man Lee Holmes has done something really nice – in support of the current PowerShell games, he’s made access to his Cookbook web site unlimited for all. See and have at it.

Thanks Lee!

Updated Lync Server Networking Guide

The Lync team at Microsoft publish a comprehensive guide to network planning, monitoring and troubleshooting of Lync.

This guide consists of a large (146 page document) ,  2 spreadsheets, 2 PowerShell scripts and a collection of SQL T-SQL scripts – not to mention a README file:

  • The document looks at the aspects of planning, monitoring and troubleshooting Lync 2013 and describes these processes in some detail.
  • The spreadsheets enable you to look at various aspect of your Lync architecture and compare your environment with best practices – for example looking at the CPU utilisation on all your servers and ensuring that they are all less than 80%. These were updated in the latest drop of the guide
  • The PowerShell scripts enable you to obtain the key health indicators in your infrastructure that can then be used within the spreadsheets.
  • The SQL scripts are queries that help you leverage the data contained on your QOA/CDR databases.These were updated in the latest drop of the guide

If you are implementing Lync, this material can be invaluable. especially if you are planning using Enterprise voice. If you used earlier version of the guide, then you would be well advised to download the latest version for the updated spread sheets and the T-SQL scripts. If you have not yet used the guide, or are early on in the planning stages of your deployment, make sure you read and work through document as you deploy.

Wednesday, January 29, 2014

Updated Lync 2013 Client for Windows Phone

I was somewhat (pleasantly) surprised to see on my Windows Phone that there was an updated Lync 2013 client. The client does not change much, but there are two nice new features added. One nice new feature is the ability to view a PowerPoint presentation during a Lync meeting. The update also enables you to use your voice to control Lync 2012 client.

For me, the ability to see a PowerPoint presentation on my phone is of pretty minimal value. That’s mainly for two reasons: first my phone (I have a Nokia 820) is just too small to do much more than listen to the audio. I’d rather be somewhere that I can watch the presentation on a decent screen (i.e. my laptop or desktop). But having said that, it would make great sense on a larger form factor device (phablet’s here we come). So while I won’t be using this feature much, I am sure glad I can!

Tuesday, January 28, 2014

SIP Trunking with Lync

I’m not alone in talking about SIP Trunking and SIP Trunking providers, as it turns out. SIP Trunks, as I discussed in this blog post, can provide a lot of benefits, not the least of which is cost reduction. The more you look at Sip Trunk Providers, though, the more you realise that not all providers are equal.

Microsoft has done a good job in qualifying Sip Trunk Providers and publishes a list of such providers at: This page lists the various qualified carriers and their service name. By ‘qualified’, each of the listed providers has been independently reviewed and their product is seen to support all the necessary Unified Communications Open Interoperability Program  (UCOIP) requirements. You can read more about these requirements here.

In his blog, Jonathan Steeman looks at some of the differences between SIP providers in terms of the functions and features they provide. The more I read this post, the more it is clear that there really is a great deal of difference between the qualified trunk providers. If you are considering a SIP trunk, then you should take a close look at this blog entry and work out which of the mentioned features are important to you.

I’d love to hear of any experiences, good or bad, you are having with any of these named providers.

Technorati Tags:

Monday, January 27, 2014

Creating A Message Box Using PowerShell

The other day, a student asked me how he could display a message box as part of a script. There is no, out of the box, cmdlet that does this, she pointed out. What she wanted to do was to display a window, with a window title and some contents, like this:

Now if you are a .NET programmer, this is pretty much a no brainer – just call the Windows.Forms.Messagebox’s Show method, and provide the text and the heading. Easy – but what if you are using PowerShell? As a Lync Admin – you might have a script that, say, provisioned users and you want to display a nice friendly message box to tell the user some bit of information such as how many users were provisioned. So how do you do that?

PowerShell, as you all know (or probably should know) is based on .NET – many cmdlets are just a PowerShell wrapper around an existing .NET Class/method. For example, Get-Process just invokes the System.Diagnostic.Process class’s GetProcesses() method. Now the cmdlet does a little more than just a GetProcess call, such as processing wild cards, enabling the cmdlet to run against a different machine, etc. But essentially, the base cmdlets just enable IT Pros simple access into .NET functions and Features. Application specific cmdlets, such as those supported by Lync, provide access into application specific functions, which are implemented as .NET Classes too. You can think of the application specific classes as just an extension to .NET.

The .NET Framework, and the Application specific ‘extensions’, are vast. There are a very large number of classes in total, and many of them have no relevance at all to the tasks that Lync admins carry out. To load all the relevant classes at runtime each time you open PowerShell would be very wasteful – both in terms of how long it would take to load them all, plus the runtime overhead (i.e. memory) wasted on classes never used. Thus, PowerShell only loads a core set of classes by default. But there is nothing stopping you from first loading the using any other .NET class.

Each .NET class is delivered via a DLL. If you look at, you can see the Systems.Diagnostics.Process class is implemented in the System.DLL (See ‘Assembly:’). System.DLL holds the core .NET functions and is always loaded by PowerShell. If you go to the page, which documents the MessageBox class, you’ll see this class is contained in System.Windows.Forms DLL, which is NOT loaded by default.
So to use the class in the first place, we need to first load the DLLs. This is pretty easy and looks like this:
This load the DLL from .NET’s global assembly cache and it remains loaded in the current PowerShell  window and memory space till you close that instance of PowerShell. If you have other assemblies either part of the .NET Framework (e.g. System.Numerics) or a privately developed assembly, you can load them in a similar fashion.

Developers and PowerShell Gurus will probably point out that the LoadWithPartialName method has been deprecated. This is true but the recommended approach is more complex. Whatever,  it remains the case that the LoadWithPartialName method works, and is likely to continue to work for some time! You can read a good explanation of this in Lee Home’s blog ( although you should note that that article was written in the Monad days, and is just slightly out of date (e.g. it uses .MSH as an extension). But for now, using this deprecated method does work and as I say, is likely to continue to work for a while!

So once you have the DLL loaded, you can just use the normal .NET calling feature to invoke a method in a .NET class directly. The core PowerShell line of code to do this is:
[Windows.Forms.MessageBox]::Show($Message, $BoxTitle, 
[Windows.Forms.MessageBoxButtons]::OK , 
Ok, so it’s three lines long but it is quite simple. But rather than have to load an assembly and call that nasty looking method, you can wrap all of this inside a simple Advanced Function, and load that in your Profile or as part of a script or suite of scripts. I’ve written a simple script that implements a Show-Message function that displays a message box as you see above – see my PowerShell scripts blog for the script.
The bottom line is that you can easily display a message box from your script if and where you need. Just leverage my script as part of your profile, a personal module or directly inside a longer script and go for it.