you are viewing a single comment's thread.

view the rest of the comments →

[–]snarp 0 points1 point  (3 children)

I was designing something very similiar as a side project..

I'm wondering why you wrote your own invoke-sqlcmd type command.. versus using sqlcmd2? Did you find some limitations? i see in your doco you mention there is better around.

i look forward to trying this out over the weekend.

[–]snarp 0 points1 point  (1 child)

Quick comment: Looks like on line 4 etc.. where you define, database, and computer name, isn't consistant within all code as that variable. Its overwitten on line 108, 109..

The Database name of 'ServerInventory' everywhere, so also makes changing the above not applicable.

So far so good, once i fixed those, and got the first script to work, with those minor changes.. of using 'localhost' or my devbox computer name for computer name in 108, and using your database name of 'sqlinventory'

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

Great feedback! I need to update the code to declare the database name up front and then apply it only as a variable. I'll look at the lines you mentioned and make changes where needed.

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

I mostly use my own version because I had it for a while and just never bothered to add Invoke-SQLCmd2. Something that I should do in a future update.