Public/Start-KeePass.ps1

Function Start-KeePass {
    <#
    .Synopsis
        Start KeePass
    .Description
        Start KeePass
    .Example
        Start-KeePass
        Starts KeePass 2
    .Inputs
        None
    .Outputs
        None
    .LINK
        about_functions_advanced
    .LINK
        about_CommonParameters
    #>

    [CmdletBinding()]
    Param()
    $keepass2 = "${env:ProgramFiles(x86)}\KeePass Password Safe 2\KeePass.exe"
    $FileExists = Test-Path $keepass2
    If ($FileExists -eq $true) {
        If (!(Get-Process KeePass -ErrorAction SilentlyContinue)) {
            Write-Verbose "Starting KeePass 2..."
            Start-Process $keepass2
        } Else {
            Throw "KeePass 2 is allready running!"
        }
    } Else {
        Throw "KeePass 2 not found, exiting..."
    }
}