Get the latest WMF5

Michael Greene tweeted the following a few days ago
M.Greene-tweet-wmf5latest

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:
get-latestwmf5-onWX

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

On Windows 2012 R2, you’ll experience the following:
get-latestwmf5-onW81

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

Advertisements

3 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.

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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