-
Notifications
You must be signed in to change notification settings - Fork 58
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
Issue: Remove-Variable : Cannot find a variable with the name 'Credential'. #174
Comments
After some testing it appears if I set my master password in $Credential it throws the error reported. $pw = ConvertTo-SecureString "password" -AsPlainText -Force If I change this so that the variable is not called $Credential and instead something different such as $MasterPassword it works without any errors. $pw = ConvertTo-SecureString "password" -AsPlainText -Force The New-KeePassEntry and Get-KeePassEntry don't throw errors. I just won't use $Credential variable as that seems to make the code unhappy. |
I have the same issue but I am not using credential, but a MasterKey instead. It works, but every time I have the error message at the end of the result. New-KeePassDatabaseConfiguration -DatabaseProfileName MyKeepPassDB -DatabasePath C:\Password.kdbx -UseMasterKey
$MasterKey = Read-Host -AsSecureString
Get-KeePassEntry -DatabaseProfileName MyKeepPassDB -MasterKey $MasterKey |
Same issue here also not using $Credentials. Everything works fine I can create groups and users in my keepass database but I always get the error message.
|
This is very strange, I had to do |
I'm nearly positive this is a variable scope issue. If you have a $credential variable for any reason (and it's not null), then the test passes ( |
I used this to get around the problem for now. IF($Credential){$MySavedCredential = $Credential; $Credential = $NULL} Update-KeePassEntry -KeePassEntry $KeePassEntry -DatabaseProfileName DAS-Database -Title $KeePassEntry.Title -KeePassPassword $PASAccountPasswordSecureString -KeePassEntryGroupPath $KeePassEntry.FullPath -ExpiryTime $PasswordExiresDate -MasterKey $MasterKey -Confirm:0 IF($MySavedCredential){$Credential = $MySavedCredential; $MySavedCredential = $NULL} Also in file: PoShKeePass.psm1 I changed line 141 to: if($script:Credential){ Remove-Variable -Name $script:Credential -EA SilentlyContinue -Confirm:0 } |
I got same issue and found this thread. |
Experiencing the same issue here on v2.1.3 when using Get-KeePassEntry, New-KeePassEntry and Update-KeePassEntry. |
$whitelist = @( echo-info "All user defined variables are removed" clear-user-vars #then report error "Cannot find a variable with the name xxx" |
I am using PoShKeePass 2.1.3.0 on Windows 10.
I created my database and configuration, when i try to add or get commands they work but they all throw an error.
Get-KeePassEntry -DatabaseProfileName testprofile -Title testentry -MasterKey $credential -AsPlainText | Select -ExpandProperty notes
I can see the notes being retrieved, but it also outputs...
My credentials are setup as follows..
This is happening with New-KeePassEntry and Get-KeePassEntry.
I can see this was reported in a earlier version and marked as fixed in bug #100 so not sure why I am getting this on latest build?
The text was updated successfully, but these errors were encountered: