Powershell · 2022-08-30

Running Entire Folder of Scripts With PowerShell

$server = 'SERVERNAME'
Get-ChildItem 'C:\Users\JSchmoe\Desktop\testrun\' | ForEach-Object{
    Invoke-Sqlcmd -ServerInstance $server -InputFile $_.FullName
}