3

Updated! Quick Win – Install PowerShell Package Management on systems running PowerShell v3 / v4

**Update 9th March 2016 PowerShell Team released an updated version of the PackageManagement modules today and I’ve updated the Script accordingly and will install the latest PackageManagement modules for you with a little verbose output

Updated Microsoft blog is at https://blogs.msdn.microsoft.com/powershell/2016/03/08/package-management-preview-march-2016-for-powershell-4-3-is-now-available/ **

 

This is a very very quick post about the latest feature being made available downlevel from Powershell v5.

As Microsoft have released PackageManagement (formally OneGet) that is now avaliable for PowerShell v3 & v4 as detailed in this link http://blogs.msdn.com/b/powershell/archive/2015/10/09/package-management-preview-for-powershell-4-amp-3-is-now-available.aspx

That’s right the ability to pull directly from the PowerShell Gallery but you need to install the Package Management release which I’ve Scripted for you here.

And what better way than a simple 1 liner to grab and run the script

Invoke-Expression (New-Object Net.WebClient).DownloadString(‘http://bit.ly/PSPackManInstaller’)

And if you want to look at the Script then direct link is http://bit.ly/PSPackManInstaller – this takes you to the RAW version of the file on Github so will not download or execute – but will allow you to read it

Hope this is useful for you

PS credit goes to @lee_holmes for the idea from following tweet https://twitter.com/lee_holmes/status/318799702869041153

3 Comments

  1. Getting an error executing the one-liner:

    Install-PowerShellPackageManagement : Missing an argument for parameter ‘Latest’. Specify a parameter of type ‘System.Diagnostics.Switch’ and try again.
    At line:54 char:37
    + Install-PowerShellPackageManagement -Latest -Verbose
    + ~~~~~~~
    + CategoryInfo : InvalidArgument: (:) [Install-PowerShellPackageManagement], ParameterBindingException
    + FullyQualifiedErrorId : MissingArgument,Install-PowerShellPackageManagement

    • Thanks for reporting this – I have pushed a fix for this issue and you should be able to run the script with no issue going forward.

Leave a Reply