PowerShell Plugin
Utilize PowerShell's Secret Management module to access secrets with the Keeper Secrets Manager PowerShell Plugin

- Retrieve secrets from the Keeper Vault to use in PowerShell
- Integrate Keeper vault with PowerShell Secrets Manager
- Update secret values in the Keeper Vault from PowerShell
- Get files from the Keeper vault
This page documents the Secrets Manager PowerShell integration. In order to utilize this integration, you will need:
Secrets Manager requires PowerShell version 6 or greater. Microsoft distributes PowerShell version 6+ as a separate application from versions 5 and earlier.
- PowerShell Version 6.0 or later
- Secrets Manager addon enabled for your Keeper account
- Membership in a Role with the Secrets Manager enforcement policy enabled
The Keeper Secrets Manager PowerShell plugin utilizes Microsoft PowerShell's Secret Management module to inject secrets from the Keeper Vault into your PowerShell scripts.
The Keeper Secrets Manager extension can be easily configured added as a secret vault into new or existing PowerShell Secret Management workflows.
For more information about PowerShell Secret Management, see the PowerShell docs on their GitHub page.
Keeper Secrets Manager uses the Microsoft.PowerShell.SecretManagement module to manage secrets in PowerShell.
Install using PowerShell:
Install-Module -Name Microsoft.PowerShell.SecretManagement
Install the Keeper Secrets Manager PowerShell extension from the PowerShell Gallery.
Install-Module -Name SecretManagement.Keeper
To update SecretManagement, use the command:
Update-Module -Name SecretManagement.Keeper
If you already have a local secrets extension that you would like to use, you can skip this step
The Keeper Secrets Manager PowerShell plugin will need a secret management extension to store the plugin configuration locally to your machine.
SecretStore
KeyChain
Install-Module -Name Microsoft.Powershell.SecretStore
Install-Module -Name SecretManagement.KeyChain
If you already have a local secrets vault registered that you would like to use, you can skip this step
Register a secret vault for the previously installed secret management extension, so that the Keeper Secrets Manager plugin configuration can be stored.
SecretStore
KeyChain
Register-SecretVault -Name LocalStore `
-ModuleName Microsoft.Powershell.SecretStore
Register-SecretVault -Name LocalStore `
-ModuleName SecretManagement.KeyChain
The name of this vault will be used to register the Keeper extension. We used
LocalStore
in this example. The Secret Management extension that you use for local storage may ask you to create a password for securely accessing the local vault.
Depending on your system settings, you may need to allow PowerShell to trust external modules. To do this, run the command:
set-executionpolicy remotesigned
Register the Keeper Secrets Manager Vault using the local vault registered above to save your credentials, and a one time token to connect to Keeper.
Replace 'XXX' below with a one time token.
Register-KeeperVault -Name Keeper `
-LocalVaultName LocalStore `
-OneTimeToken XXX
Set the Keeper vault you just added as the default secret storage. This will tell the PowerShell SecretsManagement module to use your Keeper vault when getting and setting secrets.
Set-SecretVaultDefault keeper
This step is optional, but if you choose not to do it, you may receive secrets from your default vault if they have the same name, and you will need to add
-Vault <keeper vault name>
(e.g. -Vault keeper
) to Set-Secret
commandsThe Keeper Secrets Manager PowerShell Plugin is now ready to be used
Find descriptions and examples of the most common usage of the Keeper Secrets Manager PowerShell plugin below.
For more information about PowerShell Secret Management commands, see the PowerShell docs on their GitHub page.
Run the following PowerShell command to see a list of secrets from Keeper
Command
Example
Get-SecretInfo -Vault <KEEPER VAULT NAME>
PS> Get-SecretInfo -Vault Keeper
Name Type VaultName
---- ---- ---------
bf3dg-99-Juh3feswgtFxg Home SSH Hashtable Keeper
_3zT0HvBtRdYzKTMw1IySA ACME Login Hashtable Keeper
Use the name set for your Keeper secrets vault, in the examples above we use
Keeper
.The secrets shown are any records shared with the Secrets Manager Application. The Name column displays each record's UID and title.
Get information and values of a single secret
Command
Example
Get-Secret <RECORD NAME or UID> -AsPlainText
PS> Get-Secret "ACME Login" -AsPlainText
Name Value
---- -----
login user2
password 123
Files {file1.json, file2.zip}
Wrap the record name in quotation marks when there is a space in it.
-AsPlainText
Shows the actual values of the secrets. Otherwise PowerShell shows them as a SecureString
Utilize Keeper Dot Notation to identify a field to access. Note that you do not need the 'keeper://' prefix.
Command
Example
Get-Secret <RECORD NAME OR UID>.<FIELD> -AsPlainText
PS> Get-Secret "ACME Login.password" -AsPlainText
gmzN6E8@9E97%xPB6Pg0
Update the value of a single secret field
Command
Example
Set-Secret <RECORD NAME OR UID>.<FIELD> <VALUE TO SET>
If the Keeper vault is not set as the default secret vault add
-Vault <keeper vault name>
to the commandUse dot notation to specify a file attached to a secret in the Keeper vault. Then pass that file to the
Set-Content
command to download it.Command
Example
Get-Secret <RECORD NAME OR UID>.files[<FILENAME>] `
| Set-Content -Path <FILE PATH> -AsByteStream
PS> Get-Secret my_record.files[file1.json] `
| Set-Content -Path ./file1.json -AsByteStream
The specified file will be downloaded to the path location given to
Set-Content
Last modified 1mo ago