A GitHub Action to setup PowerShell module hugoalh.GitHubActionsToolkit
(GitHub)(PowerShell Gallery).
Important
This documentation is v2.0.0 based; To view other version's documentation, please visit the versions list and select the correct version.
-
GitHub Actions Runner
🛡️ Require Permission
N/A
💽 Require Software
- PowerShell >= v7.2.0
- Import at the metadata (
action.yml
):runs: using: "composite" steps: - uses: "hugoalh-studio/setup-powershell-toolkit-ghaction@<Tag>"
- Import at the workflow (
.github/workflows/<WorkflowName>.yml
):jobs: job_id: runs-on: "________" # Any steps: - uses: "hugoalh-studio/setup-powershell-toolkit-ghaction@<Tag>"
Note
All of the inputs are optional; Use this action without any input will default to install major equitant latest version of 2.1.0
for current user, and keep the setting that modified.
<Boolean = False>
Whether to execute in sudo mode on non-Windows environment. This must set to True
in order to able install for all users on non-Windows environment (i.e.: when input scope
is "AllUsers"
).
<String = "^2.1.0">
Target version, by Semantic Versioning (SemVer) 2.0.0 with optional modifier; Default to major equitant latest version of 2.1.0
.
"Latest"
: Latest version"<1.2.3"
: Less than this version"<=1.2.3"
: Less than or equal to this version"1.2.3"
/"=1.2.3"
: Equal to this version">=1.2.3"
: Greater than or equal to this version">1.2.3"
: Greater than this version"^1.2.3"
: Between this version and major equitant latest version"~1.2.3"
: Between this version and minor equitant latest version
<Boolean = False>
Whether to allow target pre release version.
<String = "CurrentUser">
Installation scope.
"AllUsers"
: For all users. Also need to set inputsudo
toTrue
on non-Windows environment."CurrentUser"
: For current user.
<Boolean = False>
Whether to force install or reinstall target (pre release) version.
<Boolean = False>
Whether to keep the setting that modified.
<String>
Path of the installation.
<SemVer>
Version of the installation.
-
jobs: job_id: name: "Hello World" runs-on: "ubuntu-latest" steps: - name: "Setup PowerShell Toolkit" uses: "hugoalh-studio/[email protected]" - run: | Import-Module -Name 'hugoalh.GitHubActionsToolkit' -Scope 'Local' Write-GitHubActionsNotice -Message 'Hello, world!' shell: "pwsh"
- GitHub Actions