• Stars
    star
    102
  • Rank 335,584 (Top 7 %)
  • Language
    PowerShell
  • License
    MIT License
  • Created almost 8 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

:shipit: A set of commands for working with PowerShell 7.x releases.

PSReleaseTools

PSGallery Version PSGallery Downloads

This PowerShell module provides a set of commands for working with the latest releases from the PowerShell GitHub repository. The module contains commands to get summary information about the most current PowerShell version as well as functions to download some or all of the release files or install the latest stable and/or preview build of PowerShell.

These commands utilize the GitHub API, which is subject to rate limits. It is recommended that you save results of commands like Get-PSReleaseAsset to a variable. If you encounter an error message for Invoke-RestMethod like "Server Error" then you have likely exceeded the API limit. You will need to wait a bit and try again. You do not need to have or use a GitHub account to use these commands.

This module should work cross-platform on both Windows PowerShell 5.1 and PowerShell 7.x, but is primarily intended for Windows platforms.

You can install this module from the PowerShell Gallery.

Install-Module PSReleaseTools

The Module

The module currently has 9 commands:

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.

Get Current Release

The first command, Get-PSReleaseCurrent can provide a quick summary view of the latest stable or preview release.

PS C:\> Get-PSReleaseCurrent

Name                                   OnlineVersion       Released                    LocalVersion
----                                   -------------       --------                    ------------
v7.1.0 Release of PowerShell           7.1.0               11/11/2020 4:23:08 PM              7.1.0

The command writes a custom object to the pipeline which has additional properties.

PS C:\> Get-PSReleaseCurrent -preview | Select-Object *

Name         : v7.2.0-preview.2 Release of PowerShell
Version      : v7.2.0-preview.2
Released     : 12/15/2020 9:31:39 PM
LocalVersion : 7.1.0
URL          : https://github.com/PowerShell/PowerShell/releases/tag/v7.2.0-preview.2
Draft        : False
Prerelease   : True

Summary Information

Get-PSReleaseSummary queries the PowerShell repository release page and constructs a text summary. You can also have the command write the report text as markdown.

get-psreleasesummary.png

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.

PS C:\> Get-PSReleaseAsset

FileName      : powershell-7.1.0-1.centos.8.x86_64.rpm
Family        : CentOS
Format        : rpm
SizeMB        : 65
Hash          : F3985B24719534F27A6C603416C7644771E17C75AFBFD8E6D5E98390045BF9D3
Created       : 11/10/2020 8:08:04 PM
Updated       : 11/10/2020 8:08:06 PM
URL           : https://github.com/PowerShell/PowerShell/releases/download/v7.1.0/powershell-7.1.0-1.centos.8.x86_64.rpm
DownloadCount : 10509
...

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

PS C:\> Get-PSReleaseAsset -Family MacOS

FileName      : powershell-7.1.0-osx-x64.pkg
Family        : MacOS
Format        : pkg
SizeMB        : 63
Hash          : 9B7397266711B279B5413F42ABC899730539C8D78A29FD116E19A1BB78244D78
Created       : 11/10/2020 8:08:18 PM
Updated       : 11/10/2020 8:08:20 PM
URL           : https://github.com/PowerShell/PowerShell/releases/download/v7.1.0/powershell-7.1.0-osx-x64.pkg
DownloadCount : 47202

FileName      : powershell-7.1.0-osx-x64.tar.gz
Family        : MacOS
Format        : gz
SizeMB        : 63
Hash          : 10CE8B2837F30F127F866E9680F518B9AA6288222C24B62AD1CAD868FB2A66E9
Created       : 11/10/2020 8:08:21 PM
Updated       : 11/10/2020 8:08:26 PM
URL           : https://github.com/PowerShell/PowerShell/releases/download/v7.1.0/powershell-7.1.0-osx-x64.tar.gz
DownloadCount : 3657
...

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

PS C:\> Save-PSReleaseAsset -Family Ubuntu -Path D:\Temp -WhatIf
What if: Performing the operation "Downloading https://github.com/PowerShell/PowerShell/releases/download/v7.1.0/powershell_7.1.0-1.ubuntu.16.04_amd64.deb" on target "D:\temp\powershell_7.1.0-1.ubuntu.16.04_amd64.deb".
What if: Performing the operation "Downloading https://github.com/PowerShell/PowerShell/releases/download/v7.1.0/powershell_7.1.0-1.ubuntu.18.04_amd64.deb" on target "D:\temp\powershell_7.1.0-1.ubuntu.18.04_amd64.deb".
What if: Performing the operation "Downloading https://github.com/PowerShell/PowerShell/releases/download/v7.1.0/powershell_7.1.0-1.ubuntu.20.04_amd64.deb" on target "D:\temp\powershell_7.1.0-1.ubuntu.20.04_amd64.deb".

You can select multiple names. If you choose Windows, there is a dynamic parameter called -Format where you can select ZIP or MSI. Save-PSReleaseAsset supports -WhatIf.

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?

PS C:\> Get-PSReleaseAsset -Family Rhel  | Save-PSReleaseAsset -Path D:\Temp -Passthru


    Directory: D:\Temp


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a----         1/13/2021  11:13 AM       67752949 powershell-7.1.0-1.rhel.7.x86_64.rpm

The current version of this module uses regular expression named captures to pull out the file name and corresponding SHA256 hashes. The save command then calls Get-FileHash to get the current file hash and compares them.

Installing a Build

On Windows, it is pretty easy to install a new build with a one-line command:

Get-PSReleaseAsset -Family Windows -Only64Bit -Format msi |
Save-PSReleaseAsset -Path d:\temp -Passthru | Invoke-Item

Or you can use one of two newer functions to install the latest 64bit release. You can specify the interaction level.

Install-PSPreview will download the latest 64-bit preview build for Windows and kick off the installation.

Install-PSPreview -Mode Passive

Install-PowerShell will do the same thing but for the latest stable release. The command retains Install-PSCore as an alias.

Install-PowerShell -Mode Quiet -EnableRemoting -EnableContextMenu -EnableRunContext

The functionality of these commands could have been combined, but I decided to leave them as separate commands, so there is no confusion about what you are installing. In both cases, an installation log file will be created at $env:TEMP\PS7Install.log.

Non-Windows platforms have existing command-line installation tools that don't need to be replaced. Plus, I don't have the resources to develop and test installation techniques for all of the non-Windows options. That is why install-related commands in this module are limited to Windows.

Preview Builds

Beginning with v0.8.0 of this module, command functions have a -Preview parameter, which will get the latest preview build. Otherwise, the commands will use the latest stable release.

PowerShell Repository Issues

A new set of commands have been introduced in v1.8.0. These commands are intended to make it easier for you to look at issues from the PowerShell GitHub repository. The idea is that you can take a peek at open issues from your PowerShell session and then open the issue in your browser to learn more or contribute.

Get-PSIssue

Get-PSIssue is intended to get open PowerShell issues from Github. With no parameters, you can get the 25 most recent issues. Use the -Count parameter to increase that value using one of the possible values. The actual number of issues returned may vary depending on the rest of your command and how GitHub pages results.

You can also fine-tune your search to get issues that have been updated since a given date. Finally, you can also limit your search to issues tagged with a specific label.

Get-PSIssue

The function writes a custom object to the pipeline and includes a default formatted view. If you are running PowerShell 7, the issue body will be rendered as markdown.

Here is another way you might use the command.

Get-PSIssue Summary

Note: The PSIssue commands use the GitHub API and anonymous connections. The API has rate limits. If you run one of these commands excessively in a short period of time, you might see an error about exceeding the rate limit. If this happens, all you can do is wait an hour and try again. You can read more about GitHub rate-limiting here.

Get-PSIssueLabel

To make it easier to search for issues based on a label run Get-PSIssueLabel. This command will list available labels from the PowerShell repository. However, you most likely won't need to run this command often. When you import the PSReleaseTools module, it will create a global variable called $PSIssueLabel.

PS C:\> $PSIssueLabel

name                         description
----                         -----------
.NET                         Pull requests that update .net code
Area-Build
Area-Cmdlets
Area-Cmdlets-Archive
Area-Cmdlets-Core
Area-Cmdlets-Management
Area-Cmdlets-Utility
Area-Console
Area-DSC
...

This variable is used as part of an argument completer for the Labels parameter on Get-PSIssue.

Open-PSIssue

Finally, you may want to respond to an issue. If you run Open-PSIssue without any parameters, it should open the Issues section of the PowerShell repository in your browser. Or you can pipe an issue object to the command, as long as you include the Url property.

Get-PSIssue | Select-Object Updated,Labels,Title,Url | Out-GridView -PassThru | Open-PSIssue

There are no plans to add a command to open a new issue from a PowerShell session. You can use Open-PSIssue to get to GitHub and then use your browser to submit a new issue.

Support

If you have suggestions or encounter problems, please post an issue in this GitHub repository. If you find this project useful, or any of my work, please consider a small support donation.

❤️Sponsor

Last Updated 2021-10-15 15:21:21Z

More Repositories

1

PSScriptTools

🔧 🔨 A set of PowerShell functions you might use to enhance your own functions and scripts or to facilitate working in the console. Most should work in both Windows PowerShell and PowerShell 7, even cross-platform. Any operating system limitations should be handled on a per command basis. The Samples folder contains demonstration script files
PowerShell
720
star
2

ISEScriptingGeek

My library of tools and add-ons for the PowerShell ISE
PowerShell
120
star
3

WingetTools

A set of PowerShell tools for working with the winget package manager.
PowerShell
107
star
4

ADReportingTools

🧰 A set of PowerShell commands to gather information and create reports from Active Directory. 👨 👩 💻 This project relies on the Active Directory module from Microsoft.
HTML
98
star
5

PSRemoteOperations

A PowerShell module to invoke commands remotely through an out-of-band mechanism.
PowerShell
63
star
6

PSCalendar

📆 A set of PowerShell commands for displaying calendars in the console.
PowerShell
58
star
7

WTToolbox

💻 A set of PowerShell commands for managing and using the Windows Terminal application.
PowerShell
55
star
8

MyTasks

A PowerShell module that offers a simple task management or to-do system.
PowerShell
53
star
9

WindowsSandboxTools

🐫 My PowerShell scripts and tools for setting up and configuring the Windows Sandbox
PowerShell
49
star
10

PSFunctionTools

A set of PowerShell 7.x tools for automating script and module development.
PowerShell
46
star
11

PSTeachingTools

🎓 A set of commands and tools for teaching PowerShell. The module should work in Windows PowerShell, PowerShell 7.x and run cross-platform.
PowerShell
44
star
12

PSTypeExtensionTools

A set of PowerShell tools for working with type extensions.
PowerShell
40
star
13

PSVirtualBox

A PowerShell module to manage a Virtual Box environment
PowerShell
38
star
14

PSGalleryReport

PowerShell Gallery reports on recently published modules.
PowerShell
37
star
15

MemoryTools

A set of PowerShell tools for getting computer memory utilization and performance.
PowerShell
37
star
16

New-ISERemoteTab

A set of PowerShell functions to add new remote tabs in the PowerShell ISE
PowerShell
34
star
17

MySQLite

A small set of PowerShell commands for working with SQLite database files.
PowerShell
30
star
18

PSClock

⌚ A set of PowerShell commands for creating and managing a transparent WPF-based clock that runs on your Windows desktop.
PowerShell
29
star
19

PSPivotTable

A command to create an Excel-like Pivot table in the PowerShell console.
PowerShell
27
star
20

ScheduledJobTools

A Windows PowerShell module with a set of commands for managing scheduled jobs.
PowerShell
26
star
21

WindowsUpdateSetting

A set of PowerShell commands for configuring Windows Update settings on Windows 10
PowerShell
26
star
22

PSTweetChat

💬 A repository for the PSTweetChat community
PowerShell
24
star
23

ADTop10Tasks

Session material and demos for Top 10 Active Directory Management Tasks with PowerShell
23
star
24

PSBackup

A collection of PowerShell scripts and functions that I use to backup key files and folders.
PowerShell
22
star
25

myTickle

📅 A PowerShell and SQL Server-based reminder system
PowerShell
22
star
26

PSJsonCredential

A PowerShell module for exporting and importing a PSCredential to a JSON file
PowerShell
21
star
27

MyUptime

An updated version of my PowerShell module to get uptime, timezone and local time information. The module is based on a PowerShell v5 class.
PowerShell
21
star
28

PSHyperV

A set of PowerShell tools for working with Hyper-V from a Windows 10 desktop.
PowerShell
21
star
29

DNSSuffix

A set of PowerShell tools for managing the computer's primary DNS suffix.
PowerShell
19
star
30

MyMonitor

A PowerShell module for tracking where you spend your time. Use the commands in this module to track how much time you are spending on different activities based on how long a selected window is active.
PowerShell
19
star
31

PSProjectStatus

A PowerShell module for managing project status.
PowerShell
16
star
32

PSFunctionInfo

A PowerShell module for managing metadata in stand-alone functions.
PowerShell
16
star
33

PowerShellLab

My Autolab configuration for a set of virtual machines for learning PowerShell
PowerShell
16
star
34

Windows10

My AutoLab configuration files for a stand-alone Windows 10 desktop.
PowerShell
15
star
35

Demo-Class-Based-Tools

My sample demonstration files for creating class-based PowerShell tools.
PowerShell
15
star
36

PSScriptingSecrets

demo material for my PowerShell Scripting Secrets presentation
PowerShell
14
star
37

PSTimers

A PowerShell module with a variety of timer and countdown functions.
PowerShell
14
star
38

jdhitsolutions

13
star
39

PSScriptingInventory

A demonstration PowerShell module to analyze files for PowerShell commands.
PowerShell
13
star
40

Copy-Command

A PowerShell script for copying commands to create new tools.
PowerShell
13
star
41

PSChristmas

A demonstration class based PowerShell module
PowerShell
13
star
42

PSAutomationWorkshop

Materials for my PS Automation Workshop
PowerShell
12
star
43

PSWorkItem

A PowerShell 7 module for managing work and personal tasks or to-do items. This module uses a SQLite database to store task and category information. The module is not a full-featured project management solution, but should be fine for personal needs. The module requires a 64-bit Windows platform.
PowerShell
12
star
44

PSSessionExport

A PowerShell proof-of-concept module to export and import a PowerShell console session.
PowerShell
11
star
45

PSQuizMaster

A module for creating and running quizzes to learn PowerShell
PowerShell
10
star
46

WritingTools

A collection of files and PowerShell tools to assist in developing and writing a book.
PowerShell
10
star
47

PSRemotingWorkshop

Material and files from my PowerShell Remoting Deep Dive Workshop
PowerShell
10
star
48

AdvancedDSCWorkshop

demo material for my Advanced DSC Workshop
PowerShell
10
star
49

PSReadlineHelper

A PowerShell module with a functions and tools to make it easier to use the PSReadline module.
PowerShell
10
star
50

PSBitly

A PowerShell module for managing bitly links
PowerShell
10
star
51

psdatafiles

Session material from my presentation on data file formats from the PowerShell Global Summit 2018
9
star
52

myStarShip

a fun demonstration of using classes in PowerShell
PowerShell
9
star
53

ComputerCertificates

Commands for working with computer certificates
PowerShell
9
star
54

NanoDatacenter

material for my Nano-drive datacenter presentation
PowerShell
9
star
55

dscresourcedemo

Presentation material and demos on designing and developing DSC resources
8
star
56

Gen2Tools

A set of tools for working with Hyper-V Generation 2 disks
PowerShell
8
star
57

PSWebAccessAuthorization

A DSC Resource for configuring PowerShell Web Access authorization Rules
PowerShell
7
star
58

MyReminder

A PowerShell module that uses scheduled jobs as a popup reminder or alerting system.
PowerShell
7
star
59

PowerShellScriptingTraps

material for my presentation on PowerShell Scripting and Toolmaking Traps
7
star
60

PS-AutoLab-Env

An auto generated lab environment
PowerShell
7
star
61

FormatFunctions

A set of PowerShell tools to make it easier to format data values.
PowerShell
7
star
62

PSSummit2021

My demo material for the Power Up Your PowerShell Scripting session from PowerShell+DevOps Global Summit 2021.
PowerShell
6
star
63

ReportingTricksTips

Demo material for my PowerShell Reporting presentation from the PowerShell 1-Day Virtual Conference from Petri.com
6
star
64

Pluralsight-Labs

Guidance on setting labs for my Pluralsight courses
6
star
65

Mylmhost

A PowerShell module for working with the legacy lmhosts file.
PowerShell
5
star
66

Techmentor-Orlando-2022

My session material from Live360/Techmentor in Orlando November 2022
PowerShell
5
star
67

PowerShellBingo

A demonstration PowerShell module
PowerShell
5
star
68

StickyNotes

A set of PowerShell commands for working with the Sticky Notes utility in Windows.
PowerShell
5
star
69

SampleCSS

A collection of CSS files, nominally intended for use with PowerShell scripts that use ConvertTo-HTML.
CSS
5
star
70

shove

The DSC Push Server
4
star
71

PSBackToSchool

A sample solution to the Iron Scripter challenge at https://ironscripter.us/powershell-back-to-school-scripting-challenge
PowerShell
4
star
72

Techmentor2021

Session material from Live360/Techmentor 2021
HTML
4
star
73

SpiceWorld2021

Materials from my Spice World 2021 presentation on PowerShell Scripting Patterns and Practices
PowerShell
4
star
74

secure-remote-management-jea

Material for my Secure Remote Management with JEA presentation
4
star
75

DSCResourceTools

A PowerShell module for analyzing DSC resources
PowerShell
4
star
76

powershell-fast-and-furious

Material for my presentation PowerShell Fast & Furious
PowerShell
3
star
77

DataDecisions

Files and demos for my presentation on PowerShell Data Decisions
3
star
78

GitDevTest

A practice and scratch Git repository.
HTML
3
star
79

Test-Expression

DEPRECATED A PowerShell function for testing command performance. This project has been published to the PowerShell Gallery.
PowerShell
3
star
80

MyNumber

A demonstration PowerShell module of a class-based tool that creates a custom number object.
PowerShell
3
star
81

ReportingTools

A test PowerShell module for OnRamo 2022
PowerShell
2
star
82

PSNonsense

My solution to the Iron Scripter PowerShell challenge described at https://ironscripter.us/a-powershell-nonsense-challenge/.
PowerShell
2
star
83

CimFolder

PowerShell
2
star
84

MyPSTool

test repo for PowerShell Scripting in a Month of Lunches
PowerShell
2
star
85

PSThriller

A demonstration PowerShell module to generate content for a hypothetical thriller novel.
PowerShell
2
star
86

Techmentor2023-PowerShellHOL

Session material for my PowerShell Hands-On Workshop at Live360/Techmentor in Orlando, Nov. 2023
1
star
87

SpiceWorld2022-PSRegex-Intro

My presentation and demo files for my introduction to regular expressions with PowerShell for SpiceWorld 2022.
1
star
88

PowerShellRefresh

Session material from my pre-conference workshop at the PowerShell+DevOps Global Summit in 2023.
PowerShell
1
star
89

PSScriptingToolmaking

Session material from my April 2024 presentation to the Twin Cities System Management User Group.
PowerShell
1
star
90

MMSMiami-2023

My PowerShell session material for MMS Miami Beach from 2023.
PowerShell
1
star
91

PSConfAsia-2018

My session materials from PSConfAsia in Singapore, October 2018
PowerShell
1
star