Skip to content

Commit fb0b196

Browse files
committed
Initial commit
1 parent 9540541 commit fb0b196

26 files changed

+1004
-2
lines changed

.gitattributes

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Needed for publishing of examples, build worker defaults to core.autocrlf=input.
2+
* text eol=autocrlf
3+
4+
*.mof text eol=crlf
5+
*.sh text eol=lf
6+
*.svg eol=lf
7+
8+
# Ensure any exe files are treated as binary
9+
*.exe binary
10+
*.jpg binary
11+
*.xl* binary
12+
*.pfx binary
13+
*.png binary
14+
*.dll binary
15+
*.so binary
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: bug
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
1. Go to '...'
16+
2. Click on '....'
17+
3. Scroll down to '....'
18+
4. See error
19+
20+
**Expected behavior**
21+
A clear and concise description of what you expected to happen.
22+
23+
**Additional context**
24+
Add any other context about the problem here.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: enhancement
6+
assignees: ''
7+
---
8+
9+
**Is your feature request related to a problem? Please describe.**
10+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
11+
12+
**Describe the solution you'd like**
13+
A clear and concise description of what you want to happen.
14+
15+
**Additional context**
16+
Add any other context or screenshots about the feature request here.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Contributing a Pull Request
2+
3+
If you haven't already, read the full [contribution guide](https://github.com/StageCoder/StageCoder-PowerShell/blob/main/CONTRIBUTING.md). The guide may have changed since the last time you read it, so please double-check. Once you are done and ready to submit your PR, run through the relevant checklist below.
4+
5+
## Overview/Summary
6+
7+
<!--Replace this with a brief description of what this Pull Request fixes, changes, etc...-->
8+
9+
## This PR fixes/adds/changes/removes
10+
11+
1. *Replace me*
12+
2. *Replace me*
13+
3. *Replace me*
14+
15+
## As part of this Pull Request I have
16+
17+
- [ ] Checked for duplicate [Pull Requests](https://github.com/StageCoder/StageCoder-PowerShell/pulls)
18+
- [ ] Associated it with relevant [issues](https://github.com/StageCoder/StageCoder-PowerShell/issues), for tracking and closure.
19+
- [ ] Ensured my code/branch is up-to-date with the latest changes in the `main` [branch](https://github.com/StageCoder/StageCoder-PowerShell/tree/main)
20+
- [ ] Performed testing and provided evidence.
21+
- [ ] Verified build scripts work.
22+
- [ ] Updated relevant and associated documentation.

.github/workflows/release.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: Build, Test and Release
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
with:
13+
fetch-depth: 0
14+
15+
- name: Set PSModulePath
16+
shell: pwsh
17+
run: |
18+
$PSModulePath = @(
19+
[System.IO.Path]::Combine($Env:GITHUB_WORKSPACE, 'TMP', 'Modules'),
20+
$Env:PSModulePath
21+
) -join [System.IO.Path]::PathSeparator
22+
"PSModulePath=$PSModulePath" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
23+
24+
- name: Install GitVersion
25+
uses: gittools/actions/gitversion/setup@v0.9.14
26+
with:
27+
versionSpec: '5.x'
28+
29+
- name: Determine Version
30+
id: gitversion
31+
uses: gittools/actions/gitversion/execute@v0.9.14
32+
33+
- name: Setup assets cache
34+
id: assetscache
35+
uses: actions/cache@v3
36+
with:
37+
path: |
38+
TMP/Modules
39+
key: ${{ hashFiles('Scripts/BuildDependencies.ps1') }}
40+
41+
- name: Download required assemblies
42+
if: steps.assetscache.outputs.cache-hit != 'true'
43+
shell: pwsh
44+
run: ./Scripts/BuildDependencies.ps1
45+
46+
- name: Build module
47+
shell: pwsh
48+
run: ./Scripts/Build.ps1 -PublishArtifact -Version "${{steps.gitversion.outputs.LegacySemVerPadded}}"
49+
50+
- name: Publish release artifact
51+
if: startsWith(github.ref, 'refs/tags/v')
52+
uses: actions/upload-artifact@v3
53+
with:
54+
name: StageCoder.zip
55+
path: StageCoder.zip
56+
57+
release:
58+
if: startsWith(github.ref, 'refs/tags/v')
59+
runs-on: ubuntu-latest
60+
steps:
61+
62+
- name: Download artifact
63+
uses: actions/download-artifact@v3
64+
with:
65+
name: StageCoder.zip
66+
67+
- name: Publish assets
68+
uses: softprops/action-gh-release@v1
69+
with:
70+
files: StageCoder.zip
71+
env:
72+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
73+
74+
- name: Publish module to PSGallery
75+
shell: pwsh
76+
run: |
77+
Expand-Archive -Path 'StageCoder.zip'
78+
Publish-Module -Path "./StageCoder/StageCoder" -NuGetApiKey $Env:PSGALLERY_KEY -Verbose
79+
env:
80+
PSGALLERY_KEY: ${{ secrets.PSGALLERY_KEY }}
81+

.gitignore

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
output/
2+
3+
**.bak
4+
*.local.*
5+
!**/README.md
6+
.kitchen/
7+
8+
*.nupkg
9+
*.suo
10+
*.user
11+
*.coverage
12+
.vs
13+
.psproj
14+
.sln
15+
markdownissues.txt
16+
node_modules
17+
package-lock.json

CONTRIBUTING.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# Contributing to StageCoder
2+
3+
You are more than welcome to contribute to the StageCoder module, whether it is [Pull Requests](#pull-requests), [Feature Suggestions](#feature-suggestions) or [Bug Reports](#bug-reports)!
4+
5+
## Getting Started
6+
7+
- Fork this repo (see [this forking guide](https://guides.github.com/activities/forking/) for more information).
8+
- Checkout the repo locally with `git clone git@github.com:{your_username}/StageCoder-PowerShell.git`.
9+
- If you haven't already, you will need the [PlatyPs](https://github.com/PowerShell/platyPS) PowerShell Module to generate command help and docs.
10+
11+
## Developing
12+
13+
### Structure
14+
15+
The repo is organized as below:
16+
17+
- **Private** (`Src/Private`): All private functions used by the module.
18+
- **Public** (`Src/Public`): All functions exported by the module.
19+
- **Tests** (`Tests`): Pester tests executed at Pull Request.
20+
- **Help** (`Docs/Help`): Markdown help files for external help.
21+
22+
### Running the module locally
23+
24+
- Import the module:
25+
26+
```powershell
27+
Import-Module ./Src/StageCoder.psd1
28+
```
29+
30+
### platyPS
31+
32+
[platyPS](https://github.com/PowerShell/platyPS) is used to write the external help in markdown. When contributing always make sure that the changes are added to the help file.
33+
34+
#### Quickstart
35+
36+
- Install the platyPS module from the [PowerShell Gallery](https://powershellgallery.com):
37+
38+
```powershell
39+
Install-Module -Name platyPS -Scope CurrentUser
40+
Import-Module platyPS
41+
```
42+
43+
- Create initial Markdown help file for `StageCoder` module (This will only create help files for new commands, existing files will not be overwritten):
44+
45+
```powershell
46+
# you should have module imported in the session
47+
Import-Module './Src/StageCoder.psd1'
48+
New-MarkdownHelp -Command 'My-NewCommand' -OutputFolder './Docs/Help'
49+
```
50+
51+
Edit the markdown file(s) in the `./Docs/Help` folder and populate `{{ ... }}` placeholders with missed help content.
52+
53+
- If you've made a lot of changes to the module code, you can easily update the markdown file(s) automatically with:
54+
55+
```powershell
56+
# re-import your module with latest changes
57+
Import-Module './Src/StageCoder.psd1' -Force
58+
Update-MarkdownHelp './Docs/Help'
59+
```
60+
61+
## Pull Requests
62+
63+
If you like to start contributing to the StageCoder module. Please make sure that there is a related issue to link to your PR.
64+
65+
- Make sure that the issue is tagged in the PR, e.g. "fixes #45"
66+
- Write a short but informative commit message, it will be added to the release notes.
67+
68+
## Feature Suggestions
69+
70+
- Please first search [Open Issues](https://github.com/StageCoder/StageCoder-PowerShell/Issues) before opening an issue to check whether your feature has already been suggested.
71+
If it has, feel free to add your own comments to the existing issue.
72+
- Ensure you have included a "What?" - what your feature entails, being as specific as possible, and giving mocked-up syntax examples where possible.
73+
- Ensure you have included a "Why?" - what the benefit of including this feature will be.
74+
- Use the "Feature Request" issue template [here](https://github.com/StageCoder/StageCoder-PowerShell/issues/new/choose) to submit your request.
75+
76+
## Bug Reports
77+
78+
- Please first search [Open Issues](https://github.com/StageCoder/StageCoder-PowerShell/issues) before opening an issue, to see if it has already been reported.
79+
- Try to be as specific as possible, including the version of the ADOPS PowerShell module, PowerShell version and OS used to reproduce the issue, and any example files or snippets of ADOPS code needed to reproduce it.
80+
- Use the "Bug Report" issue template [here](https://github.com/StageCoder/StageCoder-PowerShell/issues/new/choose) to submit your request.

Docs/Help/Get-Demo.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
external help file: StageCoder-help.xml
3+
Module Name: StageCoder
4+
online version:
5+
schema: 2.0.0
6+
---
7+
8+
# Get-Demo
9+
10+
## SYNOPSIS
11+
Get current list of demo commands
12+
13+
## SYNTAX
14+
15+
```
16+
Get-Demo [<CommonParameters>]
17+
```
18+
19+
## DESCRIPTION
20+
Get list of current demo commands
21+
22+
## EXAMPLES
23+
24+
### Example 1
25+
```powershell
26+
PS C:\> Get-Demo
27+
```
28+
29+
Outputs list of current demo commands
30+
31+
## PARAMETERS
32+
33+
### CommonParameters
34+
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
35+
36+
## INPUTS
37+
38+
### None
39+
## OUTPUTS
40+
41+
### System.Object
42+
## NOTES
43+
44+
## RELATED LINKS

Docs/Help/Get-DemoCommand.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
---
2+
external help file: StageCoder-help.xml
3+
Module Name: StageCoder
4+
online version:
5+
schema: 2.0.0
6+
---
7+
8+
# Get-DemoCommand
9+
10+
## SYNOPSIS
11+
Get next demo command and put it in clipboard.
12+
13+
## SYNTAX
14+
15+
```
16+
Get-DemoCommand [[-Index] <Int32>] [-Passthru] [<CommonParameters>]
17+
```
18+
19+
## DESCRIPTION
20+
Get next demo command and put it in clipboard. If -Passthru is specified, the command is also returned as a string.
21+
Use this command in a PSReadLineKeyHandler to bind it to a hotkey.
22+
23+
## EXAMPLES
24+
25+
### Example 1
26+
```powershell
27+
PS C:\> Get-DemoCommand
28+
```
29+
30+
Get next demo command and put it in clipboard.
31+
32+
## PARAMETERS
33+
34+
### -Index
35+
Get a command of specific index. If not specified, the next command is returned.
36+
37+
```yaml
38+
Type: Int32
39+
Parameter Sets: (All)
40+
Aliases:
41+
42+
Required: False
43+
Position: 0
44+
Default value: None
45+
Accept pipeline input: False
46+
Accept wildcard characters: False
47+
```
48+
49+
### -Passthru
50+
Also output the command as a string.
51+
52+
```yaml
53+
Type: SwitchParameter
54+
Parameter Sets: (All)
55+
Aliases:
56+
57+
Required: False
58+
Position: Named
59+
Default value: None
60+
Accept pipeline input: False
61+
Accept wildcard characters: False
62+
```
63+
64+
### CommonParameters
65+
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
66+
67+
## INPUTS
68+
69+
### None
70+
## OUTPUTS
71+
72+
### System.Object
73+
## NOTES
74+
75+
## RELATED LINKS

0 commit comments

Comments
 (0)