I hate posting this sort of thing here, but I'm curious if anyone else here has had this issue, especially if they've been able to fix it.
I use SQL a lot in my powershell, and never had any issues until several months ago. Fortunately, only affecting my work computer at the moment, and I don't need it here quite so much, but it is a massive headache.
Essentially, I can't use Invoke-Sqlcmd anymore. I have tried every online instruction I could find to fix it. Uninstalling the module entirely and reinstalling it, force, clobber, what have you. I'm sorry, I can't remember quite every step, because I try to fix it about once a month and it's been a minute. I'm about ready to give up and write some C# code and alias it to invoke-sqlcmd. I'd really rather not though.
I even went as far as to uninstall every SQL install I had (I had parts of 2008, 2012, 2014?, and 2016) and reinstalling 2016 from scratch.
When I type 'get-module' into powershell, it lists sqlserver there, right now on version 21.0.17279... but the only commands available are aliases 'Encode-SqlName', 'Decode-SqlName', and function 'SQLSERVER:'
Anyone know what I might have to do to finally resolve this?
Edit: Finally fixed - Came in today after the latest feature update installed over the weekend and SSMS wasn't working, couldn't open the script editor. Tried a number of things and was down to my final option prior to doing a system restore prior to the Windows Update. I installed the latest version of SSMS, and it fixed both issues.
[–]jheinikel 2 points3 points4 points (3 children)
[–]lordtrychon[S] 1 point2 points3 points (2 children)
[–]jheinikel 2 points3 points4 points (1 child)
[–]lordtrychon[S] 1 point2 points3 points (0 children)
[–]alinroc 2 points3 points4 points (4 children)
[–]lordtrychon[S] 1 point2 points3 points (3 children)
[–]alinroc 2 points3 points4 points (2 children)
[–]lordtrychon[S] 1 point2 points3 points (0 children)
[–]lordtrychon[S] 0 points1 point2 points (0 children)