Skip to content

Instantly share code, notes, and snippets.

@Stuart-Moore
Created March 27, 2020 16:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Stuart-Moore/050534e08280414e6e701a08ff13fbf4 to your computer and use it in GitHub Desktop.
Save Stuart-Moore/050534e08280414e6e701a08ff13fbf4 to your computer and use it in GitHub Desktop.
ForEach ($file in (Get-ChildItem "$PSScriptRoot\scenarios" -File -Filter "*.sql" -recurse)){
(& sqlcmd -S "$sqlInstance" -U "sa" -P "Password1!$£$" -b -i "$($file.fullname)" -d "master")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment