문제

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"].

도움이 되었습니까?

해결책

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

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

다른 팁

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)

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 sharepoint.stackexchange
scroll top