Decode SCCM collection variables from CCM_CollectionVariable class in the ConfigMgr client WMI namespaces. I needed this functionality in a simple PowerShell script, so this is my implementation of that.
Roger Zander had initially implemented code similar to this in his CollVarProvider, as well as the Client Center for ConfigMgr. Both are fantastic projects and I recommend them to any SCCM administrator.