param(
  [Parameter(Mandatory = $True)] [string]$JAVA_HOME,
  [Parameter(Mandatory = $True)] [string]$PWD_FILE,
  [Parameter(Mandatory = $True)] [string]$PWD)


if ($PSVersionTable.PSVersion.Major -lt 3) 
{
	$PSScriptRoot = Split-Path -Parent -Path $MyInvocation.MyCommand.Definition
}

$LIB = "$PSScriptRoot\DBManagerCmdLine.jar"
$JAVA = "$JAVA_HOME\jre\bin\java.exe"
$CMD = "$JAVA -cp $LIB db.manager.cmd.SecurityCmd"

$CMD = "$CMD $PWD_FILE $PWD"

Invoke-Expression $CMD
