SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to use Powershell to query my Sharepoint site so I can get a list of items to use as input in my migration script. I have a document library (Site Assets), which has a folder (Calendar Pages) in it with a bunch of .aspx pages. I'd like to migrate these pages to another site.

Using Powershell, I can get a reference to the Site Assets library with: $web.Lists["Site Assets"]. I can't seem to get a reference to any objects further than this, however. I've tried $web.Lists["Site Assets"].Lists["Calendar Pages"] and $web.Lists["Site Assets"].Folders["Calendar Pages"].

share|improve this question
up vote 1 down vote accepted

No overload of the SPList.Folders collection takes a string.

Try $web.Lists["Site Assets"].RootFolder.SubFolders["Calendar Pages"].

share|improve this answer

Try this:

$web.Lists["Site Assets"].Folders | where { $_.Name -eq "Calendar Pages" }

$web.Lists["Site Assets"].Lists["Calendar Pages"] does not work because "Calendar Pages" is not a List, it's a folder.

$web.Lists["Site Assets"].Folders["Calendar Pages"] does not work because $web.Lists["Site Assets"].Folders is of type SPListItemCollection which does not allow you to index by name (only by index and guid)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.