I am going through your CBT nuggets for PowerShell tool making and I am stuck at updating the SQL Table. The function is able to get the computer names fine but just doesn’t update the table.
Keep getting the below error:
Exception calling “ExecuteNonQuery” with “0” argument(s): “Incorrect syntax near the keyword ‘WHERE’.”
At C:\Users\mohammed\Documents\WindowsPowerShell\Modules\MOLDatabase\MOLDatabase.psm1:55 char:9
$command.ExecuteNonQuery() | Out-Null
- CategoryInfo : NotSpecified: ( , MethodInvocationException
- FullyQualifiedErrorId : SqlException
I have not made any changes to your MOLDatabase.psm1.
I have attached my “MSTools.psm1” script for your reference.