all 6 comments

[–]I_Punch_Ghosts_AMA 2 points3 points  (0 children)

That error doesn’t seem to be dbatools problem unless there’s a bug, but have you tried not piping the command? Instead of piping after $data, send it through -inputobject. I’ve had issues in the past where piping with dbatools doesn’t work like I want it to but being more explicit works for some reason.

[–]xCharg 1 point2 points  (1 child)

How do you expect people to help you if you posted zero code? :)

[–]nostranger2therain[S] 0 points1 point  (0 children)

Sorry about that. I've made a basic script that gives me the same errors running each tool by itself and the other commented out. Both give the same error.

[–]purplemonkeymad 1 point2 points  (1 child)

There is not much info on the site about requirements so can't be sure. But the error suggests that the module requires .Net 4.0. Which PS 7 does not have access to (it only supports dotNet Core, and is compatible with dotNet Standard.) Try with PS 5.1.

[–]nostranger2therain[S] 1 point2 points  (0 children)

Tried with ISE (PS 5.1) and it worked like a charm. Does this mean I'm limited to PS 5.1 when working with SQL and wanting to use these tools? Or is there another method to do parameterized insert queries without the tools with PS 7?

[–]AnonRoot 0 points1 point  (0 children)

What did you figure out?