Skip to content

Commit

Permalink
📖 [Docs]: Updated READE.md with examples (#10)
Browse files Browse the repository at this point in the history
## Description

- Updated READE.md with examples.

## Type of change

<!-- Use the check-boxes [x] on the options that are relevant. -->

- [x] 📖 [Docs]
- [ ] 🪲 [Fix]
- [ ] 🩹 [Patch]
- [ ] ⚠️ [Security fix]
- [ ] 🚀 [Feature]
- [ ] 🌟 [Breaking change]

## Checklist

<!-- Use the check-boxes [x] on the options that are relevant. -->

- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
  • Loading branch information
MariusStorhaug authored Mar 17, 2024
1 parent 6f68493 commit 029d51d
Showing 1 changed file with 40 additions and 7 deletions.
47 changes: 40 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# PSModuleTemplate
# Store

A PowerShell module that manages a store of secrets and variables.
This module is designed to be a simple way to store and retrieve secrets and variables in a PowerShell script or module.

## Prerequisites

Expand All @@ -21,18 +22,50 @@ Import-Module -Name Store
Here is a list of example that are typical use cases for the module.
This section should provide a good overview of the module's capabilities.

### Example 1
### Initialize the store

The following command creates a new store with the name 'MyStore'. This results in a `config.json` file being created in `$HOME\.mystore\`.
It also ensures there is a secret vault provider created called 'SecretStore' and sets it as the default provider for the store.

If a store already exists with the type 'Microsoft.PowerShell.SecretStore', it will be used as the default provider for the store.

```powershell
Initialize-Store -Name 'MyStore'
```

### Add a variable to the store

The following command adds a variable to the store with the name 'MyVariable' and the value 'Something'.

```powershell
Add-StoreConfig -Name 'MyVariable' -Value 'Something'
```

As the value is not a secure string, it will be stored in plain text in the store json file.

### Add a secret to the store

The following command adds a secret to the store with the name 'MySecret' and the value 'Something'. The secret is stored in the default provider.

```powershell
# This is an example of how to use the module
Add-StoreConfig -Name 'MySecret' -Value ('Something' | ConvertTo-SecureString -AsPlainText -Force)
```

### Find more examples
As the value is a secure string, it will be stored securely in the secret vault.

### Get a variable or secret from the store

The following command gets the value of the variable 'MyVariable' from the store.

To find more examples of how to use the module, please refer to the [examples](examples) folder.
```powershell
Get-StoreConfig -Name 'MyVariable'
```

The following command gets the value of the secret 'MySecret' from the store.

Alternatively, you can use the Get-Command -Module 'This module' to find more commands that are available in the module.
To find examples of each of the commands you can use Get-Help -Examples 'CommandName'.
```powershell
Get-StoreConfig -Name 'MySecret'
```

## Contributing

Expand Down

0 comments on commit 029d51d

Please sign in to comment.