Sdílet prostřednictvím


Unlock-SecretStore

Unlocks SecretStore with the provided password.

Syntaxe

Default (Výchozí)

Unlock-SecretStore
    -Password <SecureString>
    [-PasswordTimeout <Int32>]
    [<CommonParameters>]

Description

This cmdlet unlocks the SecretStore for the current user with the provided password. It can be used to unlock the SecretStore when the configuration requires a password and the prompt configuration option is disabled. The SecretStore remains unlocked in the session until its configured password timeout elapses.

Příklady

Example 1

PS C:\> Get-Secret Secret1 -Vault LocalStore
Get-Secret: A valid password is required to access the Microsoft.PowerShell.SecretStore vault.
Get-Secret: The secret Secret1 wasn't found.

PS C:\> Unlock-SecretStore

cmdlet Unlock-SecretStore at command pipeline position 1
Supply values for the following parameters:
SecureStringPassword: *******

PS C:\> Get-Secret Secret1 -Vault LocalStore
System.Security.SecureString

In this example, Get-Secret fails to retrieve Secret1 because the SecretStore vault is locked. Unlock-SecretStore unlocks the vault. The cmdlet prompts for the password because the Password parameter wasn't specified. With the vault unlocked, Get-Secret returns Secret1 as a SecureString object.

Parametry

-Password

Specifies the password needed to access the SecretStore.

Vlastnosti parametru

Typ:SecureString
Default value:None
Podporuje zástupné znaky:False
DontShow:False

Sady parametrů

(All)
Position:Named
Povinné:True
Hodnota z kanálu:True
Hodnota z kanálu podle názvu vlastnosti:True
Hodnota ze zbývajících argumentů:False

-PasswordTimeout

Specifies how many seconds the SecretStore remains unlocked after authenticating with a password. This parameter overrides the configured password timeout value. After the timeout has elapsed, the current password value is invalidated for the session. Accessing the SecretStore after the timeout requires the password again.

Vlastnosti parametru

Typ:Int32
Default value:None
Podporuje zástupné znaky:False
DontShow:False

Sady parametrů

(All)
Position:Named
Povinné:False
Hodnota z kanálu:False
Hodnota z kanálu podle názvu vlastnosti:False
Hodnota ze zbývajících argumentů: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.

Vstupy

SecureString

Výstupy

None