Edit

Share via


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

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