Skip to content
This repository was archived by the owner on Oct 7, 2024. It is now read-only.

Commit 33ab663

Browse files
Upgrade PowerShell from LTS to current in GitHub Action, manifest version 7.3 again (#74)
* Update bicepVersion * upgrade powershell from LTS in pipeline * manifest 7.3 re-bump --------- Co-authored-by: Simon Wåhlin <[email protected]>
1 parent 0975164 commit 33ab663

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

.github/workflows/build.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,23 @@ jobs:
1313
with:
1414
fetch-depth: 0
1515

16-
- name: Upgrade to latest preview of powershell
16+
- name: Update PowerShell from LTS
1717
shell: pwsh
1818
run: |
19-
Invoke-Expression "& { $(irm https://aka.ms/install-powershell.ps1) } -Quiet"
20-
$env:GITHUB_PATH = '/home/runner/.powershell:' + $env:GITHUB_PATH
19+
# Most of the code is from https://aka.ms/install-powershell.ps1 but adapted for GITHUB_PATH
20+
$Destination = "~/.powershell"
21+
if (-not (Test-Path -Path $Destination)) { New-Item -ItemType Directory -Path $Destination }
22+
23+
Invoke-Expression "& { $(irm https://aka.ms/install-powershell.ps1) } -Destination $Destination"
24+
$TargetPath = Join-Path -Path $Destination -ChildPath "pwsh"
25+
$Symlink = "/usr/bin/pwsh"
26+
27+
$Uid = id -u
28+
if ($Uid -ne "0") { $SUDO = "sudo" } else { $SUDO = "" }
29+
# Make symbolic link point to installed path
30+
& $SUDO ln -fs $TargetPath $Symlink
31+
32+
if ($LASTEXITCODE -ne 0) { throw "Could not add to GITHUB_PATH: failed to make '$Symlink' point to '$TargetPath'." }
2133
2234
- name: Set PSModulePath
2335
shell: pwsh

BicepNet.PS/Manifest/BicepNet.PS.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
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.'
2727

2828
# Minimum version of the PowerShell engine required by this module
29-
PowerShellVersion = '7.2'
29+
PowerShellVersion = '7.3'
3030

3131
# Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
3232
# DotNetFrameworkVersion = '4.6.1'

0 commit comments

Comments
 (0)