I've got a directory with a bunch of SQL files ( queries ) that I'd like to execute.
What's the best way to go about it?
I can do it static but that seems a little inefficient if other files are added.
invoke-sqlcmd -inputfile "c:\temp\adduserl.sql" -serverinstance "10.129.221.91" -database "GoodOne" -username "user" -password "pw1"
invoke-sqlcmd -inputfile "c:\temp\addaddressesl.sql" -serverinstance "10.129.221.91" -database "GoodOne" -username "user" -password "pw1"
Perhaps a for loop of some sorts?