Lets assume I have the following script:
$originalPath=pwd
D:\code\ps1\misc\title.ps1 "dynamo db"
$CURPATH = "$PSScriptRoot\path.txt"
$DB_DIR= cat $CURPATH
cd $DB_DIR
java -D"java.library.path=./DynamoDBLocal_lib" -jar DynamoDBLocal.jar
cd $originalPath
This script starts the java program correctly, however, when I hit CTRL+C, the last cd command is not executed.
Is this by design for powershell? Or can I change this?