Normally, you'd just install dbatools and go, or at least use the GitHub installer script. However, if you have to deal with an older system that might be on PowerShell 4 for example, missing things like PowerShellGet, I found this useful to work through the problem and have handy for a future issue.
The key is that several features and modules aren't available in this older version.
Post fix, if you run into this more than a rare while, update your SQL Servers!