diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d6436fb..946b8cb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,11 +18,11 @@ jobs: runs-on: windows-2022 steps: # checkout - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 # Runs Pester all *.tests.ps1 scripts - name: Run Pester tests env: - GH_API_ACCESS_TOKEN: ${{ secrets.GH_API_ACCESS_TOKEN }} + GH_API_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | # Install the latest Pester module Install-Module Pester -Force diff --git a/.github/workflows/publish-module.yml b/.github/workflows/publish-module.yml index fbfb6c6..473355d 100644 --- a/.github/workflows/publish-module.yml +++ b/.github/workflows/publish-module.yml @@ -7,7 +7,7 @@ jobs: runs-on: windows-2022 steps: # checkout - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 # validate - name: validate module shell: pwsh diff --git a/PSCoreUpdate.Tests/Utils.Tests.ps1 b/PSCoreUpdate.Tests/Utils.Tests.ps1 index ebe88fe..760b428 100644 --- a/PSCoreUpdate.Tests/Utils.Tests.ps1 +++ b/PSCoreUpdate.Tests/Utils.Tests.ps1 @@ -10,6 +10,7 @@ InModuleScope 'PSCoreUpdate' { @{Expected = [AssetArchtectures]::MSI_WIN64; DownloadUrl = 'https://github.com/PowerShell/PowerShell/releases/download/v6.0.0/PowerShell-6.0.0-win-x64.msi'}, @{Expected = [AssetArchtectures]::MSI_WIN64; DownloadUrl = 'https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-alpha.18/PowerShell-6.0.0-alpha.18-win10-win2016-x64.msi'}, @{Expected = [AssetArchtectures]::MSI_WIN64; DownloadUrl = 'https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-alpha.18/PowerShell-6.0.0-alpha.18-win7-win2008r2-x64.msi'}, + @{Expected = [AssetArchtectures]::MSI_ARM64; DownloadUrl = 'https://github.com/PowerShell/PowerShell/releases/download/v7.4.3/PowerShell-7.4.3-win-arm64.msi'}, @{Expected = [AssetArchtectures]::MSIX_WIN32; DownloadUrl = 'https://github.com/PowerShell/PowerShell/releases/download/v7.0.2/PowerShell-7.0.2-win-x86.msix'}, @{Expected = [AssetArchtectures]::MSIX_WIN64; DownloadUrl = 'https://github.com/PowerShell/PowerShell/releases/download/v7.0.2/PowerShell-7.0.2-win-x64.msix'}, @{Expected = [AssetArchtectures]::MSIX_WINARM32; DownloadUrl = 'https://github.com/PowerShell/PowerShell/releases/download/v7.0.2/PowerShell-7.0.2-win-arm32.msix'}, @@ -21,6 +22,7 @@ InModuleScope 'PSCoreUpdate' { @{Expected = [AssetArchtectures]::PKG_OSX1011; DownloadUrl = 'https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-alpha.17/powershell-6.0.0-alpha.17.pkg'}, @{Expected = [AssetArchtectures]::PKG_OSX1012; DownloadUrl = 'https://github.com/PowerShell/PowerShell/releases/download/v6.0.0/powershell-6.0.0-osx.10.12-x64.pkg'}, @{Expected = [AssetArchtectures]::RPM_CM; DownloadUrl = 'https://github.com/PowerShell/PowerShell/releases/download/v7.2.6/powershell-7.2.6-1.cm.x86_64.rpm'}, + @{Expected = [AssetArchtectures]::RPM_CMARM64; DownloadUrl = 'https://github.com/PowerShell/PowerShell/releases/download/v7.4.3/powershell-7.4.3-1.cm.aarch64.rpm'}, @{Expected = [AssetArchtectures]::RPM_RH; DownloadUrl = 'https://github.com/PowerShell/PowerShell/releases/download/v7.2.0-preview.5/powershell-preview-7.2.0_preview.5-1.rh.x86_64.rpm'}, @{Expected = [AssetArchtectures]::RPM_RHEL8; DownloadUrl = 'https://github.com/PowerShell/PowerShell/releases/download/v7.0.2/powershell-7.0.2-1.centos.8.x86_64.rpm'}, @{Expected = [AssetArchtectures]::RPM_RHEL7; DownloadUrl = 'https://github.com/PowerShell/PowerShell/releases/download/v6.0.0/powershell-6.0.0-1.rhel.7.x86_64.rpm'}, @@ -41,6 +43,8 @@ InModuleScope 'PSCoreUpdate' { @{Expected = [AssetArchtectures]::TAR_LINUXALPINE64; DownloadUrl = 'https://github.com/PowerShell/PowerShell/releases/download/v6.2.2/powershell-6.2.2-linux-alpine-x64.tar.gz'}, @{Expected = [AssetArchtectures]::TAR_LINUX64; DownloadUrl = 'https://github.com/PowerShell/PowerShell/releases/download/v6.0.0/powershell-6.0.0-linux-x64.tar.gz'}, @{Expected = [AssetArchtectures]::TAR_LINUX64FXDEPENDENT; DownloadUrl = 'https://github.com/PowerShell/PowerShell/releases/download/v6.2.2/powershell-6.2.2-linux-x64-fxdependent.tar.gz'}, + @{Expected = [AssetArchtectures]::TAR_LINUXALPINE64FXDEPENDENT; DownloadUrl = 'https://github.com/PowerShell/PowerShell/releases/download/v7.4.0/powershell-7.4.0-linux-x64-musl-noopt-fxdependent.tar.gz'}, + @{Expected = [AssetArchtectures]::TAR_LINUXALPINE64FXDEPENDENT; DownloadUrl = ' https://github.com/PowerShell/PowerShell/releases/download/v7.4.0-preview.5/powershell-7.4.0-preview.5-linux-x64-alpine-fxdependent.tar.gz'}, @{Expected = [AssetArchtectures]::TAR_OSX; DownloadUrl = 'https://github.com/PowerShell/PowerShell/releases/download/v6.0.0/powershell-6.0.0-osx-x64.tar.gz'}, @{Expected = [AssetArchtectures]::TAR_OSXARM64; DownloadUrl = 'https://github.com/PowerShell/PowerShell/releases/download/v7.2.0-rc.1/powershell-7.2.0-rc.1-osx-arm64.tar.gz'}, @{Expected = [AssetArchtectures]::ZIP_WINARM32; DownloadUrl = 'https://github.com/PowerShell/PowerShell/releases/download/v6.0.0/PowerShell-6.0.0-win-arm32.zip'}, diff --git a/PSCoreUpdate/Utils.ps1 b/PSCoreUpdate/Utils.ps1 index 838b02c..803c200 100644 --- a/PSCoreUpdate/Utils.ps1 +++ b/PSCoreUpdate/Utils.ps1 @@ -47,6 +47,7 @@ enum AssetArchtectures { HASHES_SHA256 MSI_WIN32 MSI_WIN64 + MSI_ARM64 MSIX_WIN32 MSIX_WIN64 MSIX_WINARM32 @@ -56,7 +57,8 @@ enum AssetArchtectures { PKG_OSXARM64 PKG_OSX1011 PKG_OSX1012 - RPM_CM + RPM_CM + RPM_CMARM64 RPM_RH RPM_RHEL8 RPM_RHEL7 @@ -77,6 +79,7 @@ enum AssetArchtectures { TAR_LINUXALPINE64 TAR_LINUX64 TAR_LINUX64FXDEPENDENT + TAR_LINUXALPINE64FXDEPENDENT TAR_OSX TAR_OSXARM64 ZIP_WINARM32 @@ -116,6 +119,10 @@ class PowerShellCoreAsset { { $_ -match "^.+win.*-x64.msi$" } { return [AssetArchtectures]::MSI_WIN64 } + # Note : ARM64 MSI installer was released since v7.4.3 + { $_ -match "^.+win-arm64.msi$" } { + return [AssetArchtectures]::MSI_ARM64 + } { $_ -match "^.+win-x86.msix$" } { return [AssetArchtectures]::MSIX_WIN32 } @@ -142,6 +149,9 @@ class PowerShellCoreAsset { { $_ -match "^.+cm.x86_64.rpm$" } { return [AssetArchtectures]::RPM_CM } + { $_ -match "^.+cm.aarch64.rpm$" } { + return [AssetArchtectures]::RPM_CMARM64 + } # Universal rpm packeage { $_ -match "^.+rh.x86_64.rpm$" } { return [AssetArchtectures]::RPM_RH @@ -165,6 +175,9 @@ class PowerShellCoreAsset { { $_ -match "^.+linux-x64-fxdependent.tar.gz$" } { return [AssetArchtectures]::TAR_LINUX64FXDEPENDENT } + { $_ -match "^.+linux-x64-(musl-noopt|alpine)-fxdependent.tar.gz$" } { + return [AssetArchtectures]::TAR_LINUXALPINE64FXDEPENDENT + } { $_ -match "^.+osx-x64.tar.gz$" } { return [AssetArchtectures]::TAR_OSX } diff --git a/README.md b/README.md index 6fdabbf..0b928c0 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,10 @@ New cross-platform PowerShell update tool. PSCoreUpdate supports automation update of new cross-platform PowerShell (pwsh). -Currently, PowerShell Team is planning on supporting security updates of PowerShell through Microsoft Update on Windows ([#6118](https://github.com/PowerShell/PowerShell/issues/6118)), but it will take some time for realization. -[Homebrew Cask](https://caskroom.github.io/) is now available on macOS, but the installation of Homebrew is a bit heavy. +Currently, PowerShell Team is planning on supporting security updates of PowerShell through Microsoft Update on Windows ([#6118](https://github.com/PowerShell/PowerShell/issues/6118)), but it will take some time for realization. +[Homebrew Cask](https://caskroom.github.io/) is now available on macOS, but the installation of Homebrew is a bit heavy. + +PowerShell Team began supporting updates to PowerShell via Microsoft Update starting with PowerShell 7.2, but updates cannot be performed at any time, and there is no module that can manage release assets. This module is a little tool to solve such inconvenience. @@ -18,7 +20,11 @@ This module is a little tool to solve such inconvenience. You can install it from [PowerShell gallery](https://www.powershellgallery.com/packages/PSCoreUpdate). ```powershell +# Using PowerShellGet Install-Module PSCoreUpdate + +# Using Microsoft.PowerShell.PSResourceGet +Install-PSResource -Name PSCoreUpdate ``` ### Upgrade from version 2 @@ -53,7 +59,7 @@ Check if the current console is the latest version. ```powershell PS C:\> Test-LatestVersion -No updates. PowerShell 7.2.6 is the latest version. +No updates. PowerShell 7.4.3 is the latest version. ``` If you use preview release PowerShell, you can use `-Release Preview` parameter. @@ -106,18 +112,18 @@ Find PowerShell release information from GitHub. ```powershell PS C:\> Find-PowerShellRelease -MaxItems 10 -Version Name Published PreRelease -------- ---- --------- ---------- -7.2.6 v7.2.6 Release of PowerShell 8/11/2022 10:18:36 PM False -7.2.5 v7.2.5 Release of PowerShell 6/21/2022 6:34:22 PM False -7.2.4 v7.2.4 Release of PowerShell 5/17/2022 6:03:36 PM False -7.2.3 v7.2.3 Release of PowerShell 4/26/2022 11:21:03 PM False -7.2.2 v7.2.2 Release of PowerShell 3/16/2022 7:34:38 PM False -7.2.1 v7.2.1 Release of PowerShell 12/14/2021 6:15:04 PM False -7.2.0 v7.2.0 Release of PowerShell 11/8/2021 4:10:35 PM False -7.1.7 v7.1.7 Release of PowerShell 4/26/2022 11:20:43 PM False -7.1.6 v7.1.6 Release of PowerShell 3/16/2022 7:34:17 PM False -7.1.5 v7.1.5 Release of PowerShell 10/14/2021 6:21:02 PM False +Version Name Published PreRelease +------- ---- --------- ---------- +7.4.3 v7.4.3 Release of PowerShell 2024/06/18 23:13:56 False +7.4.2 v7.4.2 Release of PowerShell 2024/04/11 23:07:12 False +7.4.1 v7.4.1 Release of PowerShell 2024/01/11 23:08:30 False +7.4.0 v7.4.0 Release of PowerShell 2023/11/16 17:06:48 False +7.3.12 v7.3.12 Release of PowerShell 2024/04/11 22:57:39 False +7.3.11 v7.3.11 Release of PowerShell 2024/01/11 22:01:05 False +7.3.10 v7.3.10 Release of PowerShell 2023/11/16 17:05:59 False +7.3.9 v7.3.9 Release of PowerShell 2023/10/26 17:57:23 False +7.3.8 v7.3.8 Release of PowerShell 2023/10/10 17:15:04 False +7.3.7 v7.3.7 Release of PowerShell 2023/09/19 16:28:10 False ``` #### New features from version.3 @@ -133,24 +139,24 @@ Find-PowerShellRelease -MaxItems 10 -NoCache This parameter follows [Nuget version range](https://docs.microsoft.com/en-us/nuget/concepts/package-versioning#version-ranges) syntax. ```powershell -PS C:\> Find-PowerShellRelease -VersionRange "[7,7.1]" - -Version Name Published PreRelease -------- ---- --------- ---------- -7.1.0 v7.1.0 Release of PowerShell 11/11/2020 4:23:08 PM False -7.0.12 v7.0.12 Release of PowerShell 8/11/2022 10:15:19 PM False -7.0.11 v7.0.11 Release of PowerShell 5/17/2022 5:14:54 PM False -7.0.10 v7.0.10 Release of PowerShell 4/26/2022 11:20:14 PM False -7.0.9 v7.0.9 Release of PowerShell 3/16/2022 7:33:49 PM False -7.0.8 v7.0.8 Release of PowerShell 10/14/2021 6:20:42 PM False -7.0.7 v7.0.7 Release of PowerShell 8/12/2021 10:19:04 PM False -7.0.6 v7.0.6 Release of PowerShell 3/11/2021 11:26:32 PM False -7.0.5 v7.0.5 Release of PowerShell 2/11/2021 11:48:30 PM False -7.0.4 v7.0.4 Release of PowerShell 1/19/2021 10:22:06 PM False -7.0.3 v7.0.3 Release of PowerShell 7/16/2020 6:23:52 PM False -7.0.2 v7.0.2 Release of Powershell 6/11/2020 9:02:14 PM False -7.0.1 v7.0.1 Release of PowerShell 5/14/2020 10:52:22 PM False -7.0.0 v7.0.0 Release of PowerShell 3/4/2020 5:00:08 PM False +PS C:\> Find-PowerShellRelease -VersionRange "[7.3,7.4]" + +Version Name Published PreRelease +------- ---- --------- ---------- +7.4.0 v7.4.0 Release of PowerShell 2023/11/16 17:06:48 False +7.3.12 v7.3.12 Release of PowerShell 2024/04/11 22:57:39 False +7.3.11 v7.3.11 Release of PowerShell 2024/01/11 22:01:05 False +7.3.10 v7.3.10 Release of PowerShell 2023/11/16 17:05:59 False +7.3.9 v7.3.9 Release of PowerShell 2023/10/26 17:57:23 False +7.3.8 v7.3.8 Release of PowerShell 2023/10/10 17:15:04 False +7.3.7 v7.3.7 Release of PowerShell 2023/09/19 16:28:10 False +7.3.6 v7.3.6 Release of PowerShell 2023/07/13 22:39:48 False +7.3.5 v7.3.5 Release of PowerShell 2023/06/27 23:21:50 False +7.3.4 v7.3.4 Release of PowerShell 2023/04/13 18:37:36 False +7.3.3 v7.3.3 Release of PowerShell 2023/02/24 1:22:55 False +7.3.2 v7.3.2 Release of PowerShell 2023/01/24 19:34:31 False +7.3.1 v7.3.1 Release of PowerShell 2022/12/13 16:17:08 False +7.3.0 v7.3.0 Release of PowerShell 2022/11/09 0:37:40 False ``` ### Find-PowerShellBuildStatus @@ -162,9 +168,9 @@ PS C:\> Find-PowerShellBuildStatus -All Version Release ReleaseDate ------- ------- ----------- -7.2.6 Stable 8/11/2022 11:09:53 PM -7.3.0-preview.8 Preview 9/20/2022 8:29:39 PM -7.2.6 LTS 8/11/2022 11:09:53 PM +7.4.3 Stable 2024/06/18 23:26:06 +7.5.0-preview.3 Preview 2024/05/28 18:13:56 +7.4.3 LTS 2024/06/18 23:26:06 ``` ### Save-PowerShellAsset @@ -182,16 +188,19 @@ The types of assets are as follows. |HASHES_SHA256|hashes.sha256| |MSI_WIN32|[PowerShell version]-win-x86.msi| |MSI_WIN64|[PowerShell version]-win-x64.msi| +|MSI_ARM64|[PowerShell version]-win-arm64.msi| |MSIXBUNDLE|[PowerShell version]-win.msixbundle| |PKG_OSX|[PowerShell version]-osx-x64.pkg| |PKG_OSXARM64|[PowerShell version]-osx-arm64.pkg| |RPM_CM|[PowerShell version]-cm.x86_64.rpm| +|RPM_CMARM64|[PowerShell version]-cm.aarch64.rpm| |RPM_RH|[PowerShell version]-rh.x86_64.rpm| |DEB_DEB64|[PowerShell version]-deb_amd64.deb| |TAR_LINUXARM32|[PowerShell version]-linux-arm32.tar.gz| |TAR_LINUXARM64|[PowerShell version]-linux-arm64.tar.gz| -|TAR_LINUXALPINE64|[PowerShell version]-linux-alpine-x64.tar.gz| +|TAR_LINUXALPINE64|[PowerShell version]-linux-(musl\|alpine)-x64.tar.gz| |TAR_LINUX64FXDEPENDENT|[PowerShell version]-linux-x64-fxdependent.tar.gz| +|TAR_LINUXALPINE64FXDEPENDENT|[PowerShell version]-x64-(musl-noopt\|alpine)-fxdependent.tar.gz| |TAR_LINUX64|[PowerShell version]-linux-x64.tar.gz| |TAR_OSX|[PowerShell version]-osx-x64.tar.gz| |TAR_OSXARM64|[PowerShell version]-osx-arm64.tar.gz|