PowerShell snippet: Get optionset value/labels from Dynamics CRM Entity/Attribute

Instead of having to use the CRM interface to copy all the labels and values manually, you can save yourself a lot of time using this PowerShell script.
Using the following script file named "GetOptionSet.ps1", you can list all the value/label pairs for a given Entity + OptionSet-Attribute:
To use the script,
- install the PowerShell module "Microsoft.Xrm.Tooling.CrmConnector.PowerShell",
- open a PowerShell window,
- invoke the PowerShell file as below: