Skip to content

Instantly share code, notes, and snippets.

View gavincampbell's full-sized avatar

Gavin Campbell gavincampbell

View GitHub Profile
@gavincampbell
gavincampbell / Install-Latest-Pester.ps1
Created February 28, 2017 11:45
Powershell script to download and extract the latest version of [Pester](https://github.com/pester/Pester)
$latestRelease = Invoke-WebRequest https://github.com/pester/Pester/releases/latest -Headers @{"Accept"="application/json"}
$json = $latestRelease.Content | ConvertFrom-Json
$latestVersion = $json.tag_name
$url = "https://github.com/pester/Pester/archive/$latestVersion.zip"
$download_path = "$env:USERPROFILE\Downloads\pester-master.zip"
Invoke-WebRequest -Uri $url -OutFile $download_path
Get-Item $download_path | Unblock-File