Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
8610845
Enhance GitHub Action to support multiple OS and PowerShell versions;…
MariusStorhaug Apr 20, 2025
a26e566
Fix workflow strategy to ensure fail-fast behavior is explicitly set
MariusStorhaug Apr 20, 2025
c5bbec5
Add version testing step to Action-Test workflow
MariusStorhaug Apr 20, 2025
03ceafa
Refactor PowerShell installation process to improve version handling …
MariusStorhaug Apr 20, 2025
2362a3a
Enhance macOS installation process for PowerShell: add version retrie…
MariusStorhaug Apr 20, 2025
e108e4d
Refactor PowerShell installation process: improve version checking, u…
MariusStorhaug Apr 20, 2025
ad96cf2
Enhance version comparison logic in PowerShell installation: implemen…
MariusStorhaug Apr 20, 2025
df3c67e
Enhance version comparison logic in PowerShell installation: parse ve…
MariusStorhaug Apr 20, 2025
0fcd8c8
Fix version handling in PowerShell installation: trim 'v' prefix from…
MariusStorhaug Apr 20, 2025
4afaeb0
Fix version input handling and enhance version comparison logic in Po…
MariusStorhaug Apr 20, 2025
e67fd07
Enhance PowerShell installation logic: improve version comparison, st…
MariusStorhaug Apr 20, 2025
23bddd9
Enhance PowerShell installation on Linux: add version normalization, …
MariusStorhaug Apr 20, 2025
cb59766
Refactor PowerShell installation logic: improve version comparison fu…
MariusStorhaug Apr 20, 2025
9272ace
Refactor PowerShell installation action: improve input handling, stre…
MariusStorhaug Apr 20, 2025
4fb301b
Refactor action.yml: standardize input naming, remove unused package …
MariusStorhaug Apr 20, 2025
247296a
Refactor PowerShell installation steps: remove shared environment set…
MariusStorhaug Apr 20, 2025
e05baed
Refactor logging in PowerShell installation: replace custom log funct…
MariusStorhaug Apr 20, 2025
f6ff12f
Refactor action.yml: streamline description formatting, enhance error…
MariusStorhaug Apr 20, 2025
ba2b99a
Refactor Windows installation: enhance version detection logic, impro…
MariusStorhaug Apr 20, 2025
662112c
Refactor Linux installation: implement APT package manager support fo…
MariusStorhaug Apr 20, 2025
4b3e22e
Refactor Debian/Ubuntu installation: update APT package handling to d…
MariusStorhaug Apr 20, 2025
b944f3f
Refactor action.yml: standardize ellipsis formatting in echo and Writ…
MariusStorhaug Apr 20, 2025
102f5df
Refactor Action-Test.yml and action.yml: update version matrix for te…
MariusStorhaug Apr 20, 2025
630dd6a
remove uninstall
MariusStorhaug Apr 20, 2025
e924d13
Refactor Action-Test.yml: update version matrix to remove deprecated …
MariusStorhaug Apr 20, 2025
d13e05c
Refactor action.yml: improve PowerShell version detection logic and e…
MariusStorhaug Apr 20, 2025
e4428e1
Enhance output messaging: add requested PowerShell version to install…
MariusStorhaug Apr 20, 2025
1588830
Enhance Windows installation: add '/force' argument to msiexec for Po…
MariusStorhaug Apr 20, 2025
82866d5
Fix Windows installation: add 'REINSTALL=ALL' argument to msiexec for…
MariusStorhaug Apr 20, 2025
34bc667
Fix Windows installation: correct msiexec argument formatting for pro…
MariusStorhaug Apr 20, 2025
47cf607
Fix Windows installation: simplify msiexec command by removing Start-…
MariusStorhaug Apr 20, 2025
6db690c
Fix Windows installation: update msiexec command to use Start-Process…
MariusStorhaug Apr 20, 2025
a772963
Refactor PowerShell installation: enhance version resolution and impr…
MariusStorhaug Apr 20, 2025
4d59103
Refactor PowerShell installation: improve version resolution logic fo…
MariusStorhaug Apr 20, 2025
eea5f4d
Fix formatting in PowerShell version input description for consistency
MariusStorhaug Apr 20, 2025
a5f6597
Refactor Action-Test workflow: enhance version matrix to include 'nul…
MariusStorhaug Apr 20, 2025
985f7da
Refactor Action-Test workflow: update job name formatting for clarity…
MariusStorhaug Apr 20, 2025
948a179
Refactor PowerShell installation: improve logic for fetching the late…
MariusStorhaug Apr 20, 2025
45bce54
Refactor PowerShell installation: streamline version resolution logic…
MariusStorhaug Apr 20, 2025
ddd52b1
Refactor PowerShell installation: improve comments for clarity; stand…
MariusStorhaug Apr 20, 2025
d026fe5
Refactor PowerShell installation: correct APT package manager message…
MariusStorhaug Apr 20, 2025
0ae9ecf
Refactor PowerShell installation: add echo statements to display requ…
MariusStorhaug Apr 20, 2025
a9b92d6
Refactor PowerShell installation: update version input handling to on…
MariusStorhaug Apr 20, 2025
d7e3064
Refactor PowerShell installation: improve version resolution logic fo…
MariusStorhaug Apr 20, 2025
4967815
Refactor PowerShell installation: enhance version resolution for macO…
MariusStorhaug Apr 20, 2025
b08f77b
Refactor action metadata: update descriptions for clarity and consist…
MariusStorhaug Apr 21, 2025
0d5c320
docs: add blank line for improved readability in README.md
MariusStorhaug Apr 21, 2025
6e04ef4
Refactor PowerShell installation: update curl command to fail silentl…
MariusStorhaug Apr 21, 2025
9b2d4fc
Refactor PowerShell installation: update curl command to use jq for i…
MariusStorhaug Apr 21, 2025
5fb5941
Refactor PowerShell installation: enhance API calls with authenticati…
MariusStorhaug Apr 21, 2025
b9fb488
Refactor PowerShell installation: add GITHUB_TOKEN environment variab…
MariusStorhaug Apr 21, 2025
c269d85
Refactor Action-Test workflow: add GITHUB_TOKEN to environment variab…
MariusStorhaug Apr 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions .github/workflows/Action-Test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,12 @@ permissions:

jobs:
ActionTestBasic:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
version: ['7.4.0', '7.5.0'] # Specify the versions to test
name: Action-Test - [Basic]
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
steps:
# Need to check out as part of the test, as its a local action
- name: Checkout repo
Expand All @@ -28,5 +32,4 @@ jobs:
- name: Action-Test
uses: ./
with:
working-directory: ./tests
subject: PSModule
Version: ${{ matrix.version }}
83 changes: 47 additions & 36 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,48 +1,59 @@
name: {{ NAME }}
description: {{ DESCRIPTION }}
name: Install-PowerShell
description: Install PowerShell
author: PSModule
branding:
icon: upload-cloud
color: white

inputs:
subject:
description: The subject to greet
required: false
default: World
Debug:
description: Enable debug output.
required: false
default: 'false'
Verbose:
description: Enable verbose output.
required: false
default: 'false'
Version:
description: Specifies the version of the GitHub module to be installed. The value must be an exact version.
required: false
Prerelease:
description: Allow prerelease versions if available.
description: The version of PowerShell to install, i.e. 7.4.0 or 7.5.0. If not provided it, latest version is installed.
required: false
Comment thread
MariusStorhaug marked this conversation as resolved.
Outdated
default: 'false'
WorkingDirectory:
description: The working directory where the script will run from.
required: false
default: ${{ github.workspace }}
default: ''

runs:
using: composite
steps:
- name: {{ NAME }}
uses: PSModule/GitHub-Script@v1
env:
{{ ORG }}_{{ NAME }}_INPUT_subject: ${{ inputs.subject }}
with:
Debug: ${{ inputs.Debug }}
Prerelease: ${{ inputs.Prerelease }}
Verbose: ${{ inputs.Verbose }}
Version: ${{ inputs.Version }}
WorkingDirectory: ${{ inputs.WorkingDirectory }}
Script: |
# {{ NAME }}
${{ github.action_path }}/scripts/main.ps1
- name: Install PowerShell on Windows
if: runner.os == 'Windows'
shell: powershell
run: |
$version = '${{ inputs.version }}'
winget uninstall --id Microsoft.PowerShell --accept-source-agreements --accept-package-agreements
if ([string]::IsNullOrWhiteSpace($version)) {
winget install --id Microsoft.PowerShell --source winget --accept-package-agreements --accept-source-agreements
}
else {
winget install --id Microsoft.PowerShell --version $version --source winget --accept-package-agreements --accept-source-agreements
}

- name: Install PowerShell on Ubuntu
if: runner.os == 'Linux'
shell: bash
run: |
sudo apt-get remove powershell -y
version='${{ inputs.version }}'
if [ -z "$version" ]; then
version=$(curl -s https://api.github.com/repos/PowerShell/PowerShell/releases/latest | grep 'tag_name' | cut -d '"' -f 4)
else
version="v$version"
fi
wget https://github.com/PowerShell/PowerShell/releases/download/$version/powershell_${version#v}-1.deb_amd64.deb
sudo dpkg -i powershell_${version#v}-1.deb_amd64.deb
sudo apt-get install -f

- name: Install PowerShell on macOS
if: runner.os == 'macOS'
shell: bash
run: |
sudo rm -rf /usr/local/microsoft/powershell
version='${{ inputs.version }}'
if [ -z "$version" ]; then
version=$(curl -s https://api.github.com/repos/PowerShell/PowerShell/releases/latest | grep 'tag_name' | cut -d '"' -f 4)
else
version="v$version"
fi
pkg="powershell-${version#v}-osx.pkg"
url="https://github.com/PowerShell/PowerShell/releases/download/$version/$pkg"
curl -LO $url
sudo installer -pkg $pkg -target /
24 changes: 0 additions & 24 deletions scripts/main.ps1

This file was deleted.

3 changes: 0 additions & 3 deletions tests/README.md

This file was deleted.

Loading