Skip to content
Menu
The Lonely Administrator
  • PowerShell Tips & Tricks
  • Books & Training
  • Essential PowerShell Learning Resources
  • Privacy Policy
  • About Me
The Lonely Administrator

PowerShell 6.0 Release Tools

Posted on January 5, 2017January 5, 2017

As you should be aware, the next version of PowerShell is open source and cross-platform. You will be able to run PowerShell v6 on Windows, a Mac and select Linux distributions. All of the code is currently in alpha and hosted on the PowerShell GitHub repository. This is also where you can download new builds to install and test. I'll admit I'm a little behind the curve and part of that is because I don't often check if there is a new release. So I built a PowerShell module that will do that for me, and even download new installation packages. The best part, is that this should work cross-platform.

Manage and Report Active Directory, Exchange and Microsoft 365 with
ManageEngine ADManager Plus - Download Free Trial

Exclusive offer on ADManager Plus for US and UK regions. Claim now!

My module, called PSReleaseTools, currently has 3 commands.

  • Get-PSReleaseSummary
  • Get-PSReleaseAsset
  • Save-PSRelease

All of the functions take advantage of the GitHub API which in combination with either Invoke-RestMethod or Invoke-WebRequest, allow you to programmatically interact with GitHub.

The first command queries the PowerShell repository release page and constructs a text summary.

image

I put the release name and date right at the top so you can quickly check if you need to download something new. In GitHub, each release file is referred to as an asset. The Get-PSReleaseAsset command will query GitHub about each file and write a custom object to the pipeline.

image

By default it will display assets for all platforms, but I added a -Family parameter if you want to limit yourself to a single entry like MacOS.

image

Of course, you will want to download these files which is the job of the last command. By default the command will save all files to the current directory unless you specify a different path. You can limit the selection to a specific platform via the -Name parameter which uses a validation set.

image

You can select multiple names. If you select only Windows names then there is a dynamic parameter called Format where you can select ZIP or MSI. And the command supports -WhatIf.

image

I also realized you might run Get-PSReleaseAsset, perhaps to examine details before downloading. Since you have those objects, why not be able to pipe them to the save command? The command has Filename, Size and URL parameters which accept pipeline input by property name so that you can pipe like this:

image

By the way, I'm using the file size to test if the file downloaded completely. I know there are hashes in the release page but I didn't feel like trying to parse them out and I can't find them anywhere else. Using Size seems to work just fine.

Now I have everything I need to keep on top of the latest builds of PowerShell v6. I also have reports that this works on non-Windows systems running the v6 alpha bits. You can find the module on GitHub at https://github.com/jdhitsolutions/PSReleaseTools. Try it out everywhere and let me know how it goes. Please use Issue tracking on GitHub.

Update: Well that didn't take long. The module is now on the PowerShell Gallery so you can install it from there.

Install-Module PSReleasetools

I made one significant change and that was to rename the save function to use the same noun as Get-PSReleaseAsset for the sake of consistency. I should have done that sooner. This is especially recommended when piping from one command to another. As I was working on the save command I started down one path then realized I could include another so the command changed a bit and I didn't bother to rename it. We should be good now. Let me know how it works out for you.


Behind the PowerShell Pipeline

Share this:

  • Click to share on X (Opens in new window) X
  • Click to share on Facebook (Opens in new window) Facebook
  • Click to share on Mastodon (Opens in new window) Mastodon
  • Click to share on LinkedIn (Opens in new window) LinkedIn
  • Click to share on Pocket (Opens in new window) Pocket
  • Click to share on Reddit (Opens in new window) Reddit
  • Click to print (Opens in new window) Print
  • Click to email a link to a friend (Opens in new window) Email

Like this:

Like Loading...

Related

2 thoughts on “PowerShell 6.0 Release Tools”

  1. Martin Wiedmeyer says:
    January 6, 2017 at 1:51 pm

    Nice, Jeff…
    Think we’ll be using VS Code instead of ISE? 😉

    1. Jeffery Hicks says:
      January 6, 2017 at 2:04 pm

      On non-Windows machines I’m pretty sure that is the direction. VSCode is cross-platform and part of an editor services initiative at Microsoft. I don’t think the ISE is going away anytime soon on Windows but I wouldn’t expect it to get much in the way of updating.

Comments are closed.

reports

Powered by Buttondown.

Join me on Mastodon

The PowerShell Practice Primer
Learn PowerShell in a Month of Lunches Fourth edition


Get More PowerShell Books

Other Online Content

github



PluralSightAuthor

Active Directory ADSI Automation Backup Books CIM CLI conferences console Friday Fun FridayFun Function functions Get-WMIObject GitHub hashtable HTML Hyper-V Iron Scripter ISE Measure-Object module modules MrRoboto new-object objects Out-Gridview Pipeline PowerShell PowerShell ISE Profile prompt Registry Regular Expressions remoting SAPIEN ScriptBlock Scripting Techmentor Training VBScript WMI WPF Write-Host xml

©2025 The Lonely Administrator | Powered by SuperbThemes!
%d