Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
jkdba opened this issue Dec 6, 2017 · 0 comments · Fixed by #146
Closed

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

jkdba opened this issue Dec 6, 2017 · 0 comments · Fixed by #146
Assignees
Labels

Comments

@jkdba
Copy link
Member

jkdba commented Dec 6, 2017

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.

@jkdba jkdba added the bug label Dec 6, 2017
@jkdba jkdba self-assigned this Dec 6, 2017
jkdba added a commit that referenced this issue Jun 20, 2018
Updated dynamic parameters to take a psobject and relyies on underlying code to validate its data type as a securestring or credential.
@jkdba jkdba mentioned this issue Jun 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant