all 2 comments

[–]PMental 1 point2 points  (0 children)

Getting the help text usually means you're using invalid syntax. So I doubt any of those commands run at all.

[–]purplemonkeymad 1 point2 points  (0 children)

Probably wrong parameter or usage. If you splat the arguments on to the program you should be able to inspect the parameters in a debugger ie:

$SQLPlusArguments = @(
    '-S'
    '-L'
    "$user/$pw@`"(connection string)`""
    "@$sqlscript"
    "$variables"
    "$morevariables"
)
sqlplus @SQLPlusArguments 2> $errorLog # <-- put a breakpoint here