Checking SQL Server User Role Membership with PowerShell

Please  go and check the New SQL Bloggers posting here There are some brilliant new and older bloggers adding great value to the SQL Community

This is my most viewed post so I thought it made a good candidate to be updated and reblogged