I need to be able to run a script and get the Get-Secret and run $sqlQuery on same line
This works:
Get-Secret -Vault DBASecretStore -Name dbautil -AsPlainText | sqlplus dbautil/
But I need to be able to run $sqlQuery too and this doesn't work. I need to be able to connect then run the @sqlQuery
$sqlQuery = @"
SET LINESIZE 200
SELECT name
FROM v`$database;
"@
$sqlQuery | Get-Secret -Vault DBASecretStore -Name myuser -AsPlainText | sqlplus myuser/ > dbname.log
Write the query to disk and reference the script file in the command: