If you are working in SharePoint Management Shell and you get this error message, it probably has more to it, like:
“Verify that the local farm is properly configured….”

Have no fear, it’s a simple solution that will get you back so that you can add your solution, etc.

Go to SharePoint Management Shell (PowerShell with the SharePoint snapin) and type in the following, changing it for you as the particular user:

Add-SPShellAdmin “Yourdomain\YourUserID"