Skip to content

Commit 13896f7

Browse files
committed
Move documentation to PlayPS
1 parent 57eeb85 commit 13896f7

10 files changed

Lines changed: 360 additions & 75 deletions

File tree

.github/workflows/Publish.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Publish Module
2+
3+
on:
4+
push:
5+
tags:
6+
- "*"
7+
8+
workflow_dispatch:
9+
10+
defaults:
11+
run:
12+
shell: pwsh
13+
14+
jobs:
15+
Publish:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: 📥 Checkout
19+
uses: actions/checkout@v4
20+
21+
- name: 📦 Install required modules from PSGallery
22+
run: |
23+
Install-PSResource -Repository PSGallery -Name ModuleTools -TrustRepository
24+
Install-PSResource -Repository PSGallery -Name Microsoft.PowerShell.PlatyPS -TrustRepository
25+
Install-PSResource -Repository PSGallery -Name MarkdownPS -TrustRepository
26+
27+
- name: 🏗️ Build Module
28+
run: Invoke-MTBuild -Verbose
29+
30+
- name: 🧪 Run Pester Tests
31+
run: Invoke-MTTest
32+
33+
- name: 📝 Generate Report
34+
continue-on-error: true
35+
run: |
36+
# Get list of files in the dist directory directory
37+
$Report = New-MDHeader -Text "Output Files 📁" -Level 2
38+
$Report += Get-ChildItem -Path ./dist -Recurse | Select-Object Name, Directory | New-MDTable
39+
echo "$Report" >> $env:GITHUB_STEP_SUMMARY
40+
echo "$Report"
41+
42+
- name: 🚀 Publish Package to PSGallery
43+
run: |
44+
try {
45+
Publish-PSResource -Path ./dist/SecretBackup -Repository PSGallery -ApiKey $Env:ApiKey -Verbose
46+
} catch {
47+
Write-Error "Publishing to PSGallery failed: $($_.Exception.Message)"
48+
exit 1 # Fail the workflow on error
49+
}
50+
env:
51+
ApiKey: ${{ secrets.PSGALLERY_API }}

.github/workflows/Test.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Run Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
workflow_dispatch:
11+
12+
defaults:
13+
run:
14+
shell: pwsh
15+
16+
jobs:
17+
Tests:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: 📥 Checkout
21+
uses: actions/checkout@v4
22+
23+
- name: 📦 Install required modules from PSGallery
24+
run: |
25+
Install-PSResource -Repository PSGallery -Name ModuleTools -TrustRepository
26+
Install-PSResource -Repository PSGallery -Name Microsoft.PowerShell.PlatyPS -TrustRepository
27+
Install-PSResource -Repository MarkdownPS -Name Microsoft.PowerShell.PlatyPS -TrustRepository
28+
29+
- name: 🏗️ Build Module
30+
run: Invoke-MTBuild -Verbose
31+
32+
- name: 🧪 Run Pester Tests
33+
run: Invoke-MTTest
34+
35+
- name: 📝 Generate Report
36+
continue-on-error: true
37+
run: |
38+
# Get list of files in the dist directory directory
39+
$Report = New-MDHeader -Text "Output Files 📁" -Level 2
40+
$Report += Get-ChildItem -Path ./dist -Recurse | Select-Object Name, Directory | New-MDTable
41+
echo "$Report" >> $env:GITHUB_STEP_SUMMARY
42+
echo "$Report"

.github/workflows/Tests.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ Install-Module -Name SecretBackup
2727

2828
## Usage
2929

30+
Cmdlets are documented here - [\docs\SecretBackup](./docs/SecretBackup/SecretBackup.md)
31+
3032
### Backup Secret Store
3133

3234
To backup the PowerShell Secret Store, use the `Backup-SecretStore` cmdlet:

docs/SecretBackup/Export-Secret.md

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
---
2+
document type: cmdlet
3+
external help file: SecretBackup-Help.xml
4+
HelpUri: ''
5+
Locale: en-US
6+
Module Name: SecretBackup
7+
ms.date: 03/23/2026
8+
PlatyPS schema version: 2024-05-01
9+
title: Export-Secret
10+
---
11+
12+
# Export-Secret
13+
14+
## SYNOPSIS
15+
16+
Exports secrets from a specified vault to a JSON file.
17+
18+
## SYNTAX
19+
20+
### __AllParameterSets
21+
22+
```
23+
Export-Secret [-VaultName] <string> [[-OutPath] <string>] [<CommonParameters>]
24+
```
25+
26+
## ALIASES
27+
28+
This cmdlet has the following aliases,
29+
{{Insert list of aliases}}
30+
31+
## DESCRIPTION
32+
33+
This function exports secrets from a specified vault to a JSON file.
34+
It retrieves secret information from the vault and converts it to a JSON format for export.
35+
36+
## EXAMPLES
37+
38+
### EXAMPLE 1: Exports secrets from the 'MyVault' vault and saves the JSON file to the 'C:\Backups' directory.
39+
40+
Export-Secret -VaultName 'MyVault' -OutPath 'C:\Backups'
41+
42+
### EXAMPLE 2: Exports secrets from the 'MyVault' vault and saves the JSON file to the current location.
43+
44+
Export-Secret -VaultName 'MyVault'
45+
46+
## PARAMETERS
47+
48+
### -OutPath
49+
50+
Specifies the output path where the JSON file will be saved.
51+
If not provided, the current location will be used as the default output path.
52+
53+
```yaml
54+
Type: System.String
55+
DefaultValue: (Get-Location).Path
56+
SupportsWildcards: false
57+
Aliases: []
58+
ParameterSets:
59+
- Name: (All)
60+
Position: 1
61+
IsRequired: false
62+
ValueFromPipeline: false
63+
ValueFromPipelineByPropertyName: false
64+
ValueFromRemainingArguments: false
65+
DontShow: false
66+
AcceptedValues: []
67+
HelpMessage: ''
68+
```
69+
70+
### -VaultName
71+
72+
Specifies the name of the vault from which to export secrets.
73+
This parameter is mandatory.
74+
75+
```yaml
76+
Type: System.String
77+
DefaultValue: ''
78+
SupportsWildcards: false
79+
Aliases: []
80+
ParameterSets:
81+
- Name: (All)
82+
Position: 0
83+
IsRequired: true
84+
ValueFromPipeline: false
85+
ValueFromPipelineByPropertyName: false
86+
ValueFromRemainingArguments: false
87+
DontShow: false
88+
AcceptedValues: []
89+
HelpMessage: ''
90+
```
91+
92+
### CommonParameters
93+
94+
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
95+
-InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable,
96+
-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see
97+
[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).
98+
99+
## INPUTS
100+
101+
## OUTPUTS
102+
103+
## NOTES
104+
105+
Exports secretes in plain text.
106+
Make sure you protect the exported data.
107+
108+
109+
## RELATED LINKS
110+
111+
{{ Fill in the related links here }}
112+

docs/SecretBackup/Import-Secret.md

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
---
2+
document type: cmdlet
3+
external help file: SecretBackup-Help.xml
4+
HelpUri: ''
5+
Locale: en-US
6+
Module Name: SecretBackup
7+
ms.date: 03/23/2026
8+
PlatyPS schema version: 2024-05-01
9+
title: Import-Secret
10+
---
11+
12+
# Import-Secret
13+
14+
## SYNOPSIS
15+
16+
Imports secrets from a backup file into a specified vault.
17+
18+
## SYNTAX
19+
20+
### __AllParameterSets
21+
22+
```
23+
Import-Secret [-VaultName] <string> [-BackupFile] <string> [-OverWrite] [<CommonParameters>]
24+
```
25+
26+
## ALIASES
27+
28+
This cmdlet has the following aliases,
29+
{{Insert list of aliases}}
30+
31+
## DESCRIPTION
32+
33+
This function imports secrets from a backup file (generated by same module) into a specified vault.
34+
It checks if the secret already exists in the vault and either adds it or updates it based on the OverWrite switch parameter.
35+
36+
## EXAMPLES
37+
38+
### EXAMPLE 1: Imports secrets from the specified backup file into the "MyVault" vault, overwriting existing secrets if they already exist
39+
40+
Import-Secret -VaultName "MyVault" -BackupFile "C:\Path\to\backup.json" -OverWrite
41+
42+
43+
## PARAMETERS
44+
45+
### -BackupFile
46+
47+
The path to the backup file containing the secrets to be imported.
48+
49+
```yaml
50+
Type: System.String
51+
DefaultValue: ''
52+
SupportsWildcards: false
53+
Aliases: []
54+
ParameterSets:
55+
- Name: (All)
56+
Position: 1
57+
IsRequired: true
58+
ValueFromPipeline: false
59+
ValueFromPipelineByPropertyName: false
60+
ValueFromRemainingArguments: false
61+
DontShow: false
62+
AcceptedValues: []
63+
HelpMessage: ''
64+
```
65+
66+
### -OverWrite
67+
68+
A switch parameter that specifies whether existing secrets in the vault should be overwritten if they already exist.
69+
70+
```yaml
71+
Type: System.Management.Automation.SwitchParameter
72+
DefaultValue: False
73+
SupportsWildcards: false
74+
Aliases: []
75+
ParameterSets:
76+
- Name: (All)
77+
Position: Named
78+
IsRequired: false
79+
ValueFromPipeline: false
80+
ValueFromPipelineByPropertyName: false
81+
ValueFromRemainingArguments: false
82+
DontShow: false
83+
AcceptedValues: []
84+
HelpMessage: ''
85+
```
86+
87+
### -VaultName
88+
89+
The name of the vault where the secrets will be imported.
90+
91+
```yaml
92+
Type: System.String
93+
DefaultValue: ''
94+
SupportsWildcards: false
95+
Aliases: []
96+
ParameterSets:
97+
- Name: (All)
98+
Position: 0
99+
IsRequired: true
100+
ValueFromPipeline: false
101+
ValueFromPipelineByPropertyName: false
102+
ValueFromRemainingArguments: false
103+
DontShow: false
104+
AcceptedValues: []
105+
HelpMessage: ''
106+
```
107+
108+
### CommonParameters
109+
110+
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
111+
-InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable,
112+
-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see
113+
[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).
114+
115+
## INPUTS
116+
117+
## OUTPUTS
118+
119+
## NOTES
120+
121+
## RELATED LINKS
122+
123+
{{ Fill in the related links here }}
124+

0 commit comments

Comments
 (0)