Skip to content

Unable to Pass a Credential Object to -MasterKey Parameter #129

@jkdba

Description

@jkdba

Supposed to be able to pass a cred, or secure string to the -MasterKey parameter however for the time being only secure strings are working.

The use of the credential objects Password property works as a workaround for this issue. From the example below -MasterKey $KeeCred.**Password**.

Example usage:

# Create a Credential Object Variable
# this will prompt you for the master password for a scriptable usage please read the MS documentation # on the Get-Credential function
$KeeCred =  Get-Credential -Message 'MasterKey Password:' -UserName 'KeePass'

# make a call with this Credential using the secure string password
Get-KeePassEntry -AsPlainText -DatabaseProfileName TestDB -MasterKey $KeeCred.Password

Solution:

Update dynamic parameter loading function and update type validation on the -MasterKey parameter to support both creds and secure strings.

The underlying code already supports it.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions