Edit

Unlock-SecretVault

Unlocks an extension vault so that it can be accessed in the current session.

Syntax

Default (Default)

Unlock-SecretVault
    [-Name] <String>
    [-Password] <SecureString>
    [<CommonParameters>]

Description

Important

The PowerShell team has decided that Secret modules are feature complete and will no longer be actively developed. The modules will continue to be supported for security and critical bug fixes. The code repository has been archived.

The latest versions published are:

The nature of secrets has fundamentally changed since this project was designed. Passwordless authentication methods such as passkeys, single sign-on, and federated credential systems such as Microsoft Entra ID, biometrics, and hardware security keys are the future.

This cmdlet unlocks an extension vault using the provided Password. This allows a vault that requires password authentication to operate without first having to prompt the user. Not all extension vaults require password authentication. The cmdlet returns a warning if the extension vault doesn't support unlocking via password.

Examples

Example 1

Unlock-SecretVault -Name SecretStore -Password $SecurePassword
Get-SecretInfo -Vault SecretStore
Name             Type         VaultName
----             ----         ---------
Secret1          SecureString SecretStore
Secret2          SecureString SecretStore

This example uses the command to unlock the SecretStore vault. It then runs the Get-SecretInfo command on the vault without being prompted for the vault password.

Example 2

Unlock-SecretVault -Name CredMan -Password $SecurePassword
WARNING: Can't unlock extension vault 'CredMan': The vault doesn't support the Unlock-SecretVault
function.

This example uses the command to unlock the CredMan vault. But the vault doesn't support unlocking so the command has no effect. A warning is displayed informing that CredMan vault doesn't support unlocking.

Parameters

-Name

Name of the vault to unlock.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:0
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Password

Password used to unlock the vault.

Parameter properties

Type:SecureString
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:1
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

None

Outputs

Object