-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add pwsh-switch-parameter workflow (#11)
* Add pwsh-switch-parameter workflow * Altered path to script * Altered path to script * Reordered parameters * Moved params to single line * Removed switch * Multilined with backtick * Reordered params with switch in the middle
- Loading branch information
1 parent
8ca3644
commit 2cb6cf5
Showing
3 changed files
with
41 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/usr/bin/env pwsh | ||
[CmdletBinding()] | ||
param( | ||
[Parameter(Mandatory=$true)] | ||
[string]$ThisDoesNothing, | ||
[Parameter(Mandatory=$false)] | ||
[switch]$ThisIsASwitch, | ||
[Parameter(Mandatory=$true)] | ||
[string]$MoreNothing | ||
) | ||
|
||
$InformationPreference = "Continue" | ||
|
||
if ($ThisIsASwitch.IsPresent) { | ||
Write-Information "There is a switch present." | ||
} | ||
else { | ||
Write-Information "There isn't a switch!" | ||
} |
This file contains 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,7 +1,6 @@ | ||
name: DefaultMatrixValues | ||
|
||
on: | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
|
This file contains 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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: PowerShellSwitchParameter | ||
|
||
on: | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
run-pwsh-script: | ||
name: Run powershell script | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
|
||
- name: Test-SwitchParameter | ||
shell: pwsh | ||
run: | | ||
./.github/scripts/Test-SwitchParameter.ps1 ` | ||
-ThisDoesNothing "Nothing" ` | ||
-ThisIsASwitch ` | ||
-MoreNothing "More nothing" | ||