I was trying to validate all my SQL files using the below scripts but somehow its throwing an error. Need help.
cd D:\My_System\rgbumerch\test
Get-ChildItem .\*.sql | Select -ExpandProperty FullName | ForEach { $query = (Get-Content -Path $_); Check-Query-Syntax $str }
Error:
Check-Query-Syntax : The term 'Check-Query-Syntax' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:2 char:102
+ ... ForEach { $query = (Get-Content -Path $_); Check-Query-Syntax $str }
+ ~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Check-Query-Syntax:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
$stris also undefined..