Note to self.
When trying to filter a REST response in PowerShell, by using the “$filter” parameter in the url (as with MS CRM 2011), you must escape the “$” with “`$”.
For example:
Does not work:
$url=”http://crmserver.company.com/Organization/xrmservices/2011/OrganizationData.svc/ContactSet$filter=StateCode/Value eq 0″
Works:
$url=”http://crmserver.company.com/Organization/xrmservices/2011/OrganizationData.svc/ContactSet`$filter=StateCode/Value eq 0″
Gets me every time, and I can’t figure out why my filters are being ignored!

Comments
2 responses to “When using PowerShell to pull REST data from MS CRM, escape `$filter !”
Or try single quotes instead of double quotes being there are no single quotes or other variables that need to be expanded in the string.
I always forget that too! I hardly ever use single quotes because I usually am mashing things together!
Thanks for taking the time to comment.