The WriteObject and WriteError methods error

Hi All / @adam -

Has anyone seen this error before? I usually get this in UDgrid and UDtable, only for one specific page - others are fine. Iam using UDv2.9.

The WriteObject and WriteError methods cannot be called from outside the overrides of the BeginProcessing, ProcessRecord, and EndProcessing methods, and they can only be called from within the same thread. Validate that the cmdlet makes these calls correctly, or contact Microsoft Customer Support Services.

Can you share some of your code? I’ve never seen this before.

It seems to be related with Invoke-Sqlcmd.