Hello -
I am newbie to powershell. I am able to execute all the .SQL files from directory on to the server serially using below command. But, we want to execute all these files in parallel. CAn someone please help?
My code for serial execution -
$PSScriptRoot = 'Y:\ODS Consolidation\ODSRefresh\test\'
$ServerName = $env:COMPUTERNAME
#Invoke-Sqlcmd -InputFile $DBListScript -ServerInstance $ServerName
foreach ($f in Get-ChildItem -path $PSScriptRoot -Filter *.sql | sort-object -desc )
{
invoke-sqlcmd -InputFile $f.fullname -ServerInstance $ServerName
}