Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Execute an in-line powershell script

Gerard Vaz June 12, 2020

I need to automate a SQL script against an Oracle database using a Bamboo build via PowerShell inline commands. The credentials are not to be displayed in the inline script but managed via variables.

My code looks like this

$user = "<username>"
$password = "<password>" 
$tnsalias = "<TNS_ALIAS>"
$SqlQuery = "@C:\Test.sql"
$bambooExecutionLog = "C:\Test.log"
#
C:\sqlplus $bambooUser/$bambooPassword@$tnsalias $SqlQuery

However, it fails with the following error message

ORA-01017: invalid username/password; logon denied

Any help/suggestions would be appreciated.

1 answer

0 votes
Gerard Vaz June 15, 2020

I managed to resolve the issue myself :-)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events