I am using Sitecore 9.0 and SXA 1.8 and scaffolded a new tenant and site named New Tenant and New Site. When executing the following query using SPE I get not results:

Get-Item -Path master:// -Query "/sitecore/content/New tenant/New site//*"

I tried to use # characters to escape the space, but with no luck:

Get-Item -Path master:// -Query "fast:/sitecore/content/#New tenant#/#New site#//*"

Rebuilding the link database does not help either.

When I remove the spaces from the items and the query it (immediately) works:

Get-Item -Path master:// -Query "/sitecore/content/tenant/*"

How to query in SPE for items that contain spaces?

  • I just tried Get-Item -Path master:// -Query "/sitecore/content/SiteName/Home/About/#News and Events#/#Press Releases#//*" in my solution and it is working perfect for me – Yogesh Sharma Jun 7 '19 at 9:10
  • After waiting a while and adding spaces again it works fine, even without the # characters. Could it be caching? – Joost Jun 7 '19 at 9:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.