I ended up just installing SqlServer module again with using the force and it solved the problem. I was using an older version of SqlServer and you need to use v22.
Find versions in Powershell (as admin): Get-Module SqlServer -ListAvailable
Install latest: Install-Module -Name SqlServer -Force