Get the latest WMF5

Michael Greene tweeted the following a few days ago

I love his idea and his code shows a few awesome tricks I ignored:

I propose the following improvements:

  • Insert a require statement to tell people that the code is only v3 compatible. There’s no Invoke-Webrequest in PowerShell 2.0.
  • Download the required version based on the OS where you run the code. If you’ve PowerShell 3.0 on Windows 7 64bit, you’ll get the Windows6.1-KB2908075-x64.msu file, etc.

Let’s have a look at my proposal

On Windows 10, you don’t need this piece of code, so you’ll just get a warning:

On Windows 7 as of PowerShell 3.0, you get the following experience:

On Windows 2012 R2, you’ll experience the following:

Last warning: WMF 5.0 requires .Net Framework 4.5, make sure this requirement is met before installing the WMF 5.0.


5 thoughts on “Get the latest WMF5

  1. Nifty Stuff !
    Just an off-topic question, how do you preserve the indentation in posting your code blocks ? i use the

     code here 

    which formats the code, but strips my identation 😦
    Thanks !

    • When I paste code in wordprese, I use ‘sourcecode language=”powershell”‘ in square brackets.
      In this post, the code is hosted on github and I just ‘gist the-url-of-the-code-on-github /’ in square brackets.

  2. It looks like this is broken now :-/
    On a Win2k12 server, the scripts just halts and doesn’t seem to do anything, and when stepping through the scripts, it doesn’t seem to pick up the url for the latest WMF…

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 )

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.