Completely newbie simple powershell question I am trying to do the following - for each *.sql file in the current directory run
sqlplus username/password@connect_identifier_specified_in_argument @file_name
Here is what I have so far:
$scripts = dir *.sql
foreach($script in $scripts) {
write-host sqlplus username/password"@"$args "@"$script.Name
}
(I know write-host outputs it to the screen, I'm just trying to debug for now)
However, there is something funky with how powershell treats the @ character and when I run this I always get something like
PS C:\code\scripts> C:\utils\run_sql_scripts_on.ps1 identifier
sqlplus username/password@identifier @ ALERTS.sql
See that space after the "@"? What gives?