This PowerShell module offers essential functionality for backing up (exporting as JSON) and restoring the PowerShell Secret Store. Designed to complement the SecretManagement module, it supports any compatible store extension.
- Provides Cross-platform capability to backup and restore (e.g., Windows to Mac) Secrets.
- Migrate secrets from one store backend to different one. (e.g., KeePass to AzureVault Migration).
Warning
This module complements SecretManagement module and assumes that you have at least one secret store configured and working.
- Export PowerShell Secret Store as plain JSON
- Restore PowerShell Secret Store from JSON
- Retain any metadata content in secret
Important
Currently it supports secret saved as string, securestring and PSCredential only, does not support secret of type Byte and Hastable
To install the module, you can use the PowerShell Gallery:
Install-Module -Name SecretBackup
To backup the PowerShell Secret Store, use the Backup-SecretStore
cmdlet:
Export-Secret -VaultName 'MyVault' -OutPath 'C:\Backups'
# 'C:\Backups\Backup_Vault.json' will contain all exported secrets
To restore the PowerShell Secret Store from a backup, use the Import-SecretStore
cmdlet:
Import-Secret -VaultName "MyOtherVault" -BackupFile 'C:\Backups\Backup_Vault.json'
- PowerShell 7.0 or later
- SecretManagement module
- SecretStore module (if using the built-in PowerShell Secret Store)
- Support BYTE and Hastable type secrets
- Encrypted output using passphrase
Contributions are welcome! Please fork the repository and submit a pull request with your changes. Ensure that your code adheres to the existing style and includes appropriate tests.
This project is licensed under the MIT License. See the LICENSE file for details.
Warning
In early development stage, expect breaking changes