diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a97eeee..aad1026 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,11 +13,23 @@ jobs: with: fetch-depth: 0 - - name: Upgrade to latest preview of powershell + - name: Update PowerShell from LTS shell: pwsh run: | - Invoke-Expression "& { $(irm https://aka.ms/install-powershell.ps1) } -Quiet" - $env:GITHUB_PATH = '/home/runner/.powershell:' + $env:GITHUB_PATH + # Most of the code is from https://aka.ms/install-powershell.ps1 but adapted for GITHUB_PATH + $Destination = "~/.powershell" + if (-not (Test-Path -Path $Destination)) { New-Item -ItemType Directory -Path $Destination } + + Invoke-Expression "& { $(irm https://aka.ms/install-powershell.ps1) } -Destination $Destination" + $TargetPath = Join-Path -Path $Destination -ChildPath "pwsh" + $Symlink = "/usr/bin/pwsh" + + $Uid = id -u + if ($Uid -ne "0") { $SUDO = "sudo" } else { $SUDO = "" } + # Make symbolic link point to installed path + & $SUDO ln -fs $TargetPath $Symlink + + if ($LASTEXITCODE -ne 0) { throw "Could not add to GITHUB_PATH: failed to make '$Symlink' point to '$TargetPath'." } - name: Set PSModulePath shell: pwsh diff --git a/BicepNet.PS/Manifest/BicepNet.PS.psd1 b/BicepNet.PS/Manifest/BicepNet.PS.psd1 index a3213be..add3676 100644 --- a/BicepNet.PS/Manifest/BicepNet.PS.psd1 +++ b/BicepNet.PS/Manifest/BicepNet.PS.psd1 @@ -26,7 +26,7 @@ BicepNet is developed for the Bicep PowerShell module but could be used for any other project where you want to leverage Bicep functionality in PowerShell or .NET.' # Minimum version of the PowerShell engine required by this module - PowerShellVersion = '7.2' + PowerShellVersion = '7.3' # Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only. # DotNetFrameworkVersion = '4.6.1'