PSKeePass / PoShKeePass

PowerShell module for KeePass
MIT License
256 stars 58 forks source link

Get-KeePassEntry unable to retrieve entries from sub-groups #183

Closed DamionD closed 4 years ago

DamionD commented 4 years ago

Version: 2.1.3.0

I am able to create entries within a subgroup of a KeePass database: New-KeePassEntry -DatabaseProfileName Test -KeePassEntryGroupPath "KBDX/Group" -Title "Test" -KeePassPassword (ConvertTo-SecureString -String "TestPass" -AsPlainText -Force) -MasterKey $Password But am unable to retrieve them:

Get-KeePassEntry -DatabaseProfileName Test -MasterKey $Password -Title 'Test' -KeePassEntryGroupPath "KBDX\Group" -AsPlainText
WARNING: [PROCESS] The Specified KeePass Entry Group Path () does not exist.
The Specified KeePass Entry Group Path () does not exist.
At C:\Program Files\WindowsPowerShell\Modules\PoShKeePass\2.1.3.0\PoShKeePass.psm1:2414 char:13
+             Throw 'The Specified KeePass Entry Group Path ({0}) does  ...
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (The Specified K...does not exist.:String) [], RuntimeException
    + FullyQualifiedErrorId : The Specified KeePass Entry Group Path () does not exist.

I can retrieve entries from the top level group however:

Get-KeePassEntry -DatabaseProfileName Test -MasterKey $Password -Title 'Test' -KeePassEntryGroupPath "KBDX" -AsPlainText

Title UserName Password FullPath Notes
----- -------- -------- -------- -----
Test           TestPass KBDX
jkdba commented 4 years ago

@DamionD I believe you need to use a '/' forward slash in your KeePassEntryGroupPath just as you did in the creation of the sub entry.

I had no issue when testing this.

DamionD commented 4 years ago

@DamionD I believe you need to use a '/' forward slash in your KeePassEntryGroupPath just as you did in the creation of the sub entry.

I had no issue when testing this.

@jkdba Well, don't I feel stupid?! Thanks for getting me on the right track (I can't believe I missed that!)

Cheers, DamionD