To assign a Teams phone number using powershell you need to make sure the right licenses are added to the user, you can find the steps here:
After the license is assigned you can now use PowerShell to assign the phone number.
- Open PowerShell as an administrator
- Connect to Teams module using: Connect-MicrosoftTeams
- Run the following command, change the user name, and add the phone number: Set-CsPhoneNumberAssignment -Identity "<User name>" -PhoneNumber <phone number> -PhoneNumberType DirectRouting
- Hit Enter
Allow a few minutes for the system to synchronize, after that the user should be able to use the new phone number assigned.