Edit

Share via


Set-SecretStorePassword

Replaces the current SecretStore password with a new one.

Syntax

NoParameterSet (Default)

Set-SecretStorePassword
    [<CommonParameters>]

ParameterSet

Set-SecretStorePassword
    -NewPassword <SecureString>
    [-Password <SecureString>]
    [<CommonParameters>]

Description

This cmdlet updates the password for SecretStore.

Examples

Example 1

PS C:\> Set-SecretStorePassword
Old password
Enter password:
*******
New password
Enter password:
*******
Enter password again for verification:
*******

This example runs the command with no parameter arguments. The user is first prompted for the old password. And then prompted for the new password twice for verification.

Example 2

PS C:\> Set-SecretStorePassword -NewPassword $newPassword -Password $oldPassword

This example runs the command passing in both the current store password and the new password to be set.

Parameters

-NewPassword

Specifies the new password for accessing the SecretStore. If this parameter isn't specified and the cmdlet is run in an interactive session, it prompts the user for the value. If this parameter is not specified and the cmdlet is run in a non-interactive session, it returns an error.

Parameter properties

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

Parameter sets

ParameterSet
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-Password

Existing password needed to unlock the store. This can be ignored if the store doesn't currently use a password.

Specifies the existing password for accessing the SecretStore. If the SecretStore isn't configured to require a password, this parameter is ignored.

If the SecretStore is configured to require a password, this parameter isn't specified, and the cmdlet is run in an interactive session, it prompts the user for the value. If the SecretStore is configured to require a password, this parameter isn't specified and the cmdlet is run in a non-interactive session, it returns an error.

Parameter properties

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

Parameter sets

ParameterSet
Position:Named
Mandatory:False
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

None