Set-SecretStoreConfiguration

Configures the SecretStore.

Syntax

Set-SecretStoreConfiguration
   [-Scope <SecureStoreScope>]
   [-Authentication <Authenticate>]
   [-PasswordTimeout <Int32>]
   [-Interaction <Interaction>]
   [-Password <SecureString>]
   [-PassThru]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-SecretStoreConfiguration
   [-Default]
   [-Password <SecureString>]
   [-PassThru]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

This cmdlet configures the SecretStore for the current user.

Examples

Example 1

PS C:\> Set-SecretStoreConfiguration -Default

Confirm
Are you sure you want to perform this action?
Performing the operation "Changes local store configuration" on target "SecretStore module local store".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): Y

      Scope Authentication PasswordTimeout Interaction
      ----- -------------- --------------- -----------
CurrentUser       Password             900      Prompt

This example restores the SecretStore to its default configuration.

Parameters

-Authentication

Specifies how to authenticate access to the SecretStore. The value must be Password or None. If specified as None, the cmdlet enables access to the SecretStore without a password. The default authentication is Password.

Caution

Setting the Authentication to None is less secure than Password. Specifying None may be useful for testing scenarios but should not be used with important secrets.

Type:Authenticate
Position:Named
Default value:Password
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Default

Indicates that the SecretStore should be set to its default configuration.

Type:SwitchParameter
Position:Named
Default value:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Interaction

Specifies whether the SecretStore should prompt a user when they access it. If the value is Prompt, the user is prompted for their password in interactive sessions when required. If the value is None, the user is not prompted for a password. If the value is None and a password is required, the cmdlet requiring the password throws a Microsoft.PowerShell.SecretStore.PasswordRequiredException error.

Type:Interaction
Position:Named
Default value:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-PassThru

Indicates that the cmdlet should return the SecretStore configuration after updating it. By default, the cmdlet returns no output.

Type:SwitchParameter
Position:Named
Default value:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Password

Specifies the password needed to access the SecretStore. This parameter cannot be used to change the existing password. To change the existing password, use Set-SecretStorePassword.

When this parameter is used with the Authenticate parameter to change the configuration for authentication from None to Password, this parameter's value is set as the new password for the SecretStore.

When this parameter is used with the Authenticate parameter to change the configuration for authentication from Password to None, this parameter's value must be the current password for the SecretStore. It is used to authorize the configuration change.

Type:SecureString
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-PasswordTimeout

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

Type:Int32
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Scope

Specifies the context the SecretStore is configured for. Only CurrentUser is currently supported.

Type:SecureStoreScope
Accepted values:CurrentUser, AllUsers
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

None

Outputs

Microsoft.PowerShell.SecretStore.SecureStoreConfig