In the PowerShell snippet below when I run the code with the line commendted out the script returns the list and all it's items. If I then swap the lines out and use the "ID" corresponding to that of the title and attempt to retrieve the list it fails to locate it. Is there something obvious I'm doing wrong here?
function CheckTaskInSites($task)
{
$workspacesSites = $rootWeb.Lists[$workspaceslist]
foreach($workspaceItem in $workspacesSites.Items)
{
Write-host "1 Check task Title :" $workspaceItem.Title
Write-host $workspaceItem["Service ID"]
#$web = $site.OpenWeb($workspaceItem.Title)
$web = $site.OpenWeb($workspaceItem.ID)
CheckTaskIDInSite $task $web
$web.Dispose()
}
}
Thanks