JustinGrote/SecretManagement.KeePass

Keypass Database not being created on vault registration

Opened this issue · 0 comments

Hello,

I'm having issues with creating keepass databased with the module:
I'm using the Create switch (set to $true) to create the keepass database according to:

https://github.com/JustinGrote/SecretManagement.KeePass/blob/main/SecretManagement.KeePass/Public/Register-KeePassSecretVault.ps1

When running the code, no exceptions are raised. No file is created as well.

Sample Code:

$KeePassDB = "C:\Temp\keepass.kdbx"

# set up the value for the VaultParameters parameter
$VParams = @{ 
    Path    = $KeePassDB 
    UseMasterPassword = $true
    MasterPassword    = 'pwd' | ConvertTo-SecureString -AsPlainText -Force
    Create = $true
}

# Set a vault name and if it exists then unregister that vault in this session
$VaultName = 'KPVault01'
Register-SecretVault -Name $VaultName -ModuleName SecretManagement.keepass  -VaultParameters $VParams -Verbose

Manually running Register-KeepassSecretVault raises the following exception:

Register-KeepassSecretVault @VParams
Resolve-Path : Cannot find path 'C:\Temp\keepass.kdbx' because it does not exist.
At C:\Program Files\WindowsPowerShell\Modules\SecretManagement.keepass\0.9.2\SecretManagement.KeePass.psm1:50 char:17
+         $Path = Resolve-Path $Path
+                 ~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (C:\Temp\keepass.kdbx:String) [Resolve-Path], ItemNotFoundException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.ResolvePathCommand