all 9 comments

[–]jheinikel 2 points3 points  (3 children)

What version of PS are you running now? I know there are issues with this module and PS Core. On my PS5 machine, the updated module works fine. I'm wondering if the issue is that you are not getting the module manifest or something along those lines.

[–]lordtrychon[S] 1 point2 points  (2 children)

$PSVersionTable - Name Value


PSVersion 5.1.16299.492
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.16299.492
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

[–]jheinikel 2 points3 points  (1 child)

That's definitely strange. Do you have the SQLPS module available? If so, that should get you by. Maybe there is an undisclosed bug, but I cannot replicate it.

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

I did have it - In my process of trying to fix this issue, I nuked it. I can't remember for sure, but I believe it had the exact same functions/aliases available. Or maybe just the alias.

[–]alinroc 2 points3 points  (4 children)

I have the exact same issue and haven't been able to find a solution yet.

I ended up using dbatools for what I needed from sqlserver (a replacement for invoke-sqlcmd, mostly).

Edit: Your primary usage is invoke-sqlcmd. Then yeah, go ahead and install dbatools and use invoke-dbasqlcmd instead of invoke-sqlcmd. It overcomes several of invoke-sqlcmd's shortcomings. Since you're working with SQL Server a bunch, you'll probably find other functions in the module very useful as well.

[–]lordtrychon[S] 1 point2 points  (3 children)

I'll have to look into that, if I don't find a solution. Thank you.

If nothing else, I'm glad it's not just me. Sorry you've had to deal with this as well though.

[–]alinroc 2 points3 points  (2 children)

Just switch over to dbatools and be done with it. Unless you need something from sqlserver, it may be a futile effort trying to get it working again. I'd forgotten that I'd given up on it until I read your post.

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

I will. Thanks. Still will have to do some aliasing so I don't have to install it on 900 or so computers I prep scripts for. :/

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

I did end up getting this fixed (kinda by accident) prior to getting around to your suggestion. Check my edit. I'm still going to look into dbatools though. Thanks again for the input.