Universal Nightly Releases

If anyone is feeling like futzing with nightly releases, they will start being listed here: https://imsreleases.z19.web.core.windows.net/

The current page doesn’t have a link to the release notes, but that will be included as well.

I wrote a very nasty/slap-dash function (on windows) to pull the latest nightly from the above url, its not perfect but it does the job for me, so anyone visiting, feel free to use.

I’m using this to initially download the nightly, and have in my script the following actions: stop my IIS site, unpack the zip, update universal and then restart my IIS site.

function get-universalnightly {

    param(

        $url = "https://imsreleases.blob.core.windows.net/universal-nightly",

        [ValidateSet('win','osx','linux','msi')]$type = "win",

        [ValidateScript({

            if( -Not ($_ | Test-Path) ){

                throw "Folder does not exist"

            }

            return $true

        })][System.IO.FileInfo]$destination

    )

    switch($type){

        "win" {

            $filename = "Universal.win"

            $extension = "zip"

        }

        "osx" {

            $filename = "Universal.osx"

            $extension = "zip"

        }

        "linux" {

            $filename = "Universal.linux"

            $extension = "zip"

        }

        "msi" {

            $filename = "PowerShellUniversal"

            $extension = "msi"

        }

    }

    [xml]$UniversalBuildList  = (Invoke-RestMethod "$url`?restype=container&comp=list") -replace "",""

    [pscustomobject]$UniversalBuildList = $UniversalBuildList.EnumerationResults.Blobs.blob

    $latestbuild = (($UniversalBuildList | sort name -Descending | select -First 1).name -split "/")[0]

    $downloadpath = ($UniversalBuildList | ?{$_.name -like "$latestbuild/$filename*$extension"}).url

    try{

        Invoke-WebRequest $downloadpath -OutFile "$($destination.fullname)\$(($downloadpath -split "/")[-1])"

    }catch{throw}

}

get-universalnightly -type "win" -destination "d:\mypath\"
2 Likes