I'm using this process to load a folder full of .sql files there are Stored Procedures that I would like to add to a Newly created DB. It runs
into errors but doesn't log with .sql file it had a problem loading.
Any help finding which ones loaded and which failed in some sort of LOG file?
foreach ($f in Get-ChildItem -path "f:\20210421190105\StoredProcedure\" -Filter *.sql | sort-object)
$out = "C:\temp\" + $f.name.split(".") + ".txt" ;
invoke-sqlcmd –ServerInstance (local) -Database test1-InputFile $f.fullname | format-table | out-file -filePath $out