Created
December 18, 2019 09:27
-
-
Save aadennis/b5ccacb23b9d00e6a4a66f2b046ef9ea to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$funcVars = @( | |
"name='john'", | |
"age=22" | |
) | |
$dbServer = "localhost" | |
$dbPrefix = "AA_" | |
$dbName = "SomeDb" | |
$inputFile = "$PSScriptRoot\x.sql" | |
$database = "$($dbPrefix)$($dbName)" | |
$user = "sa" | |
$pwd = "Alive123" | |
$envParams = @{ | |
ServerInstance = $dbServer | |
Database = $database | |
InputFile = $inputFile | |
User = $user | |
Password = $pwd | |
} | |
$envParams['Variable'] = $funcVars | |
Invoke-Sqlcmd @envParams |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment