-
Notifications
You must be signed in to change notification settings - Fork 27
Closed
Description
I'm trying to set a new password for SecretStore using parameter arguments rather than interactively.
Based on what's written in the documentation, something like this should work when no password have been previously set:
Set-SecretStorePassword -NewPassword $newPassword
However I'm getting this error and cannot leave the -Password argument blank, no matter my input type:
PS C:\Users\k> Set-SecretStorePassword -NewPassword $MyCredential.Password
Set-SecretStorePassword : Cannot bind parameter 'NewPassword'. Cannot convert the "System.Security.SecureString" value
of type "System.String" to type "System.Security.SecureString".
At line:1 char:38
+ Set-SecretStorePassword -NewPassword System.Security.SecureString
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Set-SecretStorePassword], ParameterBindingException
+ FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Microsoft.PowerShell.SecretStore.SetSecretStorePasswordCo
mmand
PS C:\Users\k> pSet-SecretStorePassword -NewPassword '123'
Set-SecretStorePassword : Cannot bind parameter 'NewPassword'. Cannot convert the "123" value of type "System.Int32"
to type "System.Security.SecureString".
At line:1 char:38
+ Set-SecretStorePassword -NewPassword 123
+ ~~~
+ CategoryInfo : InvalidArgument: (:) [Set-SecretStorePassword], ParameterBindingException
+ FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Microsoft.PowerShell.SecretStore.SetSecretStorePasswordCo
mmand
Relevant documentation below:
Set-SecretStorePassword
-NewPassword
[-Password ]
with
-Password
Existing password needed to unlock the store. This can be ignored if the store doesn't currently use a password.
Any idea how to fix this? Thank you!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels