0

Is there a difference between checking a pages library and a list in terms of powershell commands?

The following cmdlet is not returning me an item, and when I checked the browser I see the list item with that id

Its a pages library

It says item does not exist or it may have been deleted by another user.

$spSite = Get-SPSite "https://mysite.com"
$spWeb = $spSite.OpenWeb("https://mysite.com/myweb/practical-tips")
$affected = $spWeb.GetList("/Pages")
$manager=$site.workflowmanager
$culture=[system.globalization.cultureinfo]::currentculture
$association=$affected.workflowassociations.getassociationbyname($wfname,$culture)
$data=$association.associationdata
$wfname="News approval workflow"
$wfrunoption=[microsoft.sharepoint.workflow.spworkflowrunoptions]::synchronous

$item = $affected.GetItemById(80)
2

SpWeb.GetList wants "The server-relative URL to the root folder of a list", like in your case:

$spWeb.GetList("/myweb/practical-tips/Pages")

http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spweb.getlist.aspx

Your Answer

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

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