Chocolatey Fest - Chocolatey's inaugural conference on Windows Automation (WinOps) is coming - Learn more!

This is not the latest version of KeePass Plugin KPScript available.

KeePass Plugin KPScript

2.36

Package test results are passing.

This package was approved as a trusted package on 7/27/2017.

KPScript allows automating database operations in KeePass. There are two ways to automate KeePass: single command operations and KPScript files:

  • Command Operations: KPScript can be invoked using single commands. By passing the database location, its key, a command and eventually some parameters, simple operations like adding an entry can be performed. The syntax is very simple, no scripting knowledge is required. This method is ideal when you quickly want to do some small changes to the database. It is not recommended when you need to perform many operations, because for each command the database needs to be loaded from file, decrypted, modified, encrypted and written back to file.
  • C# Script Files: These files are a lot more powerful than single command operations, but are also more complicated. You need to have heavy experience in C# programming and the KeePass 2.x internals. Within KPS files you can do everything that KeePass does.

To install KeePass Plugin KPScript, run the following command from the command line or from PowerShell:

C:\> choco install keepass-plugin-kpscript --version 2.36

To upgrade KeePass Plugin KPScript, run the following command from the command line or from PowerShell:

C:\> choco upgrade keepass-plugin-kpscript --version 2.36

Files

Hide
  • tools\chocolateyInstall.ps1 Show
    # powershell v2 compatibility
    $psVer = $PSVersionTable.PSVersion.Major
    if ($psver -ge 3) {
      function Get-ChildItemDir {Get-ChildItem -Directory $args}
    } else {
      function Get-ChildItemDir {Get-ChildItem $args}
    }
    $packageName = 'keepass-plugin-kpscript'
    $packageSearch = 'KeePass Password Safe'
    $url = 'http://keepass.info/extensions/v2/kpscript/KPScript-2.36.zip'
    $checksum = '4e8268a80ab5b2e8b8054c058209dbda000f8036490dfeacf8b46610bee0f04c'
    $checksumType = 'sha256'
    try {
    # search registry for location of installed KeePass
    $regPath = Get-ItemProperty -Path @('HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*',
                                        'HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*',
                                        'HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*') `
                                -ErrorAction:SilentlyContinue `
               | Where-Object {$_.DisplayName -like "$packageSearch*" `
                               -and `
                               $_.DisplayVersion -ge 2.29 `
                               -and `
                               $_.DisplayVersion -lt 3.0 } `
               | ForEach-Object {$_.InstallLocation}
    $installPath = $regPath
    # search $env:ChocolateyBinRoot for portable install
    if (! $installPath) {
      Write-Verbose "$($packageSearch) not found installed."
      $binRoot = Get-BinRoot
      $portPath = Join-Path $binRoot "keepass"
      $installPath = Get-ChildItemDir $portPath* -ErrorAction SilentlyContinue
    }
    if (! $installPath) {
      Write-Verbose "$($packageSearch) not found in $($env:ChocolateyBinRoot)"
      throw "$($packageSearch) location could not be found."
    }
    $pluginPath = (Get-ChildItemDir $installPath\Plugin*).FullName
    if ($pluginPath.Count -eq 0) {
      $pluginPath = Join-Path $installPath "Plugins"
      [System.IO.Directory]::CreateDirectory($pluginPath)
    }
    # download and extract PLGX file into Plugins dir
    Install-ChocolateyZipPackage -PackageName "$packageName" `
                                 -Url "$url" `
                                 -UnzipLocation "$pluginPath" `
                                 -Checksum "$checksum" `
                                 -ChecksumType "$checksumType"
    if ( Get-Process -Name "KeePass" `
                     -ErrorAction SilentlyContinue ) {
      Write-Warning "$($packageSearch) is currently running. Plugin will be available at next restart of $($packageSearch)." 
    } else {
      Write-Output "$($packageName) will be loaded the next time KeePass is started."
      Write-Output "Please note this plugin may require additional configuration. Look for a new entry in KeePass' Menu>Tools"
    }} catch {
      throw $_.Exception
    }
  • tools\chocolateyUninstall.ps1 Show
    # powershell v2 compatibility
    $psVer = $PSVersionTable.PSVersion.Major
    if ($psver -ge 3) {
      function Get-ChildItemDir {Get-ChildItem -Directory $args}
    } else {
      function Get-ChildItemDir {Get-ChildItem $args}
    }
    $packageName = 'keepass-plugin-kpscript'
    $typName = 'KPScript.exe'
    $packageSearch = 'KeePass Password Safe'
    try {
    # search registry for installed KeePass
    $regPath = Get-ItemProperty -Path @('HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*',
                                        'HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*',
                                        'HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*') `
                                -ErrorAction:SilentlyContinue `
               | Where-Object {$_.DisplayName -like "$packageSearch*"} `
               | ForEach-Object {$_.InstallLocation}
    $installPath = $regPath
    # search $env:ChocolateyBinRoot for portable install
    if (! $installPath) {
      Write-Verbose "$($packageSearch) not found in registry."
      $binRoot = Get-BinRoot
      $portPath = Join-Path $binRoot "keepass"
      $installPath = Get-ChildItemDir $portPath* -ErrorAction SilentlyContinue
    }
    if (! $installPath) {
      Write-Verbose "$($packageSearch) not found in $($env:ChocolateyBinRoot)"
      throw "$($packageSearch) install location could not be found."
    }
    $pluginPath = (Get-ChildItemDir $installPath\Plugin*).FullName
    if ($pluginPath.Count -eq 0) {
      throw "Plugins directory not found."
    }
    $installFile = Join-Path $pluginPath $typName
    Remove-Item -Path $installFile `
                -Force `
                -ErrorAction Continue
    if ( Get-Process -Name "KeePass" `
                     -ErrorAction SilentlyContinue ) {
      Write-Warning "$($packageSearch) is running. $($packageName) will be removed at next restart of $($packageSearch)." 
    }
    } catch {
      throw $_.Exception
    }

Virus Scan Results

In cases where actual malware is found, the packages are subject to removal. Software sometimes has false positives. Moderators do not necessarily validate the safety of the underlying software, only that a package retrieves software from the official distribution point and/or validate embedded software against official distribution point (where distribution rights allow redistribution).

Chocolatey Pro provides runtime protection from possible malware.

Dependencies

Package Maintainer(s)

Software Author(s)

  • Dominik Reichl

Copyright

© 2007 Dominik Reichl

Tags

Release Notes

Program

Package

  • Automatically built and uploaded by dtgm

Version History

Version Downloads Last updated Status
KeePass Plugin KPScript 2.37 195 Tuesday, December 19, 2017 approved
KeePass Plugin KPScript 2.36 243 Thursday, July 27, 2017 approved
KeePass Plugin KPScript 2.35 288 Saturday, January 21, 2017 approved
KeePass Plugin KPScript 2.34 276 Saturday, June 11, 2016 approved
KeePass Plugin KPScript 2.33 133 Saturday, May 7, 2016 approved
KeePass Plugin KPScript 2.32 168 Wednesday, March 9, 2016 approved
KeePass Plugin KPScript 2.31 183 Saturday, January 9, 2016 approved
KeePass Plugin KPScript 2.30 173 Tuesday, August 11, 2015 approved
KeePass Plugin KPScript 2.29 180 Sunday, July 19, 2015 approved

Discussion for the KeePass Plugin KPScript Package

Ground rules:

  • This discussion is only about KeePass Plugin KPScript and the KeePass Plugin KPScript package. If you have feedback for Chocolatey, please contact the google group.
  • This discussion will carry over multiple versions. If you have a comment about a particular version, please note that in your comments.
  • The maintainers of this Chocolatey Package will be notified about new comments that are posted to this Disqus thread, however, it is NOT a guarantee that you will get a response. If you do not hear back from the maintainers after posting a message below, please follow up by using the link on the left side of this page or follow this link to contact maintainers. If you still hear nothing back, please follow the package triage process.
  • Tell us what you love about the package or KeePass Plugin KPScript, or tell us what needs improvement.
  • Share your experiences with the package, or extra configuration or gotchas that you've found.
  • If you use a url, the comment will be flagged for moderation until you've been whitelisted. Disqus moderated comments are approved on a weekly schedule if not sooner. It could take between 1-5 days for your comment to show up.

comments powered by Disqus
Chocolatey.org uses cookies to enhance the user experience of the site.
Ok