-
Notifications
You must be signed in to change notification settings - Fork 2
🌟 [Major]: Introducing Install-PowerShell action
#1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
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 a26e566
Fix workflow strategy to ensure fail-fast behavior is explicitly set
MariusStorhaug c5bbec5
Add version testing step to Action-Test workflow
MariusStorhaug 03ceafa
Refactor PowerShell installation process to improve version handling …
MariusStorhaug 2362a3a
Enhance macOS installation process for PowerShell: add version retrie…
MariusStorhaug e108e4d
Refactor PowerShell installation process: improve version checking, u…
MariusStorhaug ad96cf2
Enhance version comparison logic in PowerShell installation: implemen…
MariusStorhaug df3c67e
Enhance version comparison logic in PowerShell installation: parse ve…
MariusStorhaug 0fcd8c8
Fix version handling in PowerShell installation: trim 'v' prefix from…
MariusStorhaug 4afaeb0
Fix version input handling and enhance version comparison logic in Po…
MariusStorhaug e67fd07
Enhance PowerShell installation logic: improve version comparison, st…
MariusStorhaug 23bddd9
Enhance PowerShell installation on Linux: add version normalization, …
MariusStorhaug cb59766
Refactor PowerShell installation logic: improve version comparison fu…
MariusStorhaug 9272ace
Refactor PowerShell installation action: improve input handling, stre…
MariusStorhaug 4fb301b
Refactor action.yml: standardize input naming, remove unused package …
MariusStorhaug 247296a
Refactor PowerShell installation steps: remove shared environment set…
MariusStorhaug e05baed
Refactor logging in PowerShell installation: replace custom log funct…
MariusStorhaug f6ff12f
Refactor action.yml: streamline description formatting, enhance error…
MariusStorhaug ba2b99a
Refactor Windows installation: enhance version detection logic, impro…
MariusStorhaug 662112c
Refactor Linux installation: implement APT package manager support fo…
MariusStorhaug 4b3e22e
Refactor Debian/Ubuntu installation: update APT package handling to d…
MariusStorhaug b944f3f
Refactor action.yml: standardize ellipsis formatting in echo and Writ…
MariusStorhaug 102f5df
Refactor Action-Test.yml and action.yml: update version matrix for te…
MariusStorhaug 630dd6a
remove uninstall
MariusStorhaug e924d13
Refactor Action-Test.yml: update version matrix to remove deprecated …
MariusStorhaug d13e05c
Refactor action.yml: improve PowerShell version detection logic and e…
MariusStorhaug e4428e1
Enhance output messaging: add requested PowerShell version to install…
MariusStorhaug 1588830
Enhance Windows installation: add '/force' argument to msiexec for Po…
MariusStorhaug 82866d5
Fix Windows installation: add 'REINSTALL=ALL' argument to msiexec for…
MariusStorhaug 34bc667
Fix Windows installation: correct msiexec argument formatting for pro…
MariusStorhaug 47cf607
Fix Windows installation: simplify msiexec command by removing Start-…
MariusStorhaug 6db690c
Fix Windows installation: update msiexec command to use Start-Process…
MariusStorhaug a772963
Refactor PowerShell installation: enhance version resolution and impr…
MariusStorhaug 4d59103
Refactor PowerShell installation: improve version resolution logic fo…
MariusStorhaug eea5f4d
Fix formatting in PowerShell version input description for consistency
MariusStorhaug a5f6597
Refactor Action-Test workflow: enhance version matrix to include 'nul…
MariusStorhaug 985f7da
Refactor Action-Test workflow: update job name formatting for clarity…
MariusStorhaug 948a179
Refactor PowerShell installation: improve logic for fetching the late…
MariusStorhaug 45bce54
Refactor PowerShell installation: streamline version resolution logic…
MariusStorhaug ddd52b1
Refactor PowerShell installation: improve comments for clarity; stand…
MariusStorhaug d026fe5
Refactor PowerShell installation: correct APT package manager message…
MariusStorhaug 0ae9ecf
Refactor PowerShell installation: add echo statements to display requ…
MariusStorhaug a9b92d6
Refactor PowerShell installation: update version input handling to on…
MariusStorhaug d7e3064
Refactor PowerShell installation: improve version resolution logic fo…
MariusStorhaug 4967815
Refactor PowerShell installation: enhance version resolution for macO…
MariusStorhaug b08f77b
Refactor action metadata: update descriptions for clarity and consist…
MariusStorhaug 0d5c320
docs: add blank line for improved readability in README.md
MariusStorhaug 6e04ef4
Refactor PowerShell installation: update curl command to fail silentl…
MariusStorhaug 9b2d4fc
Refactor PowerShell installation: update curl command to use jq for i…
MariusStorhaug 5fb5941
Refactor PowerShell installation: enhance API calls with authenticati…
MariusStorhaug b9fb488
Refactor PowerShell installation: add GITHUB_TOKEN environment variab…
MariusStorhaug c269d85
Refactor Action-Test workflow: add GITHUB_TOKEN to environment variab…
MariusStorhaug File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
| 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 / | ||
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.