I am able to retrieve the
List name of a document library with the following
However, I encountered the following error for the following
The difference is the additional
/Lists/ component in the 2nd URL.
Below is my code snippet, may I know how can I tackle this issue?
$baseUrl="http://test.com/" $web = Get-SPWeb $baseUrl $RDlistName ="RecordsDocument" //success $FPlistName ="Lists/FilePlan" //failed //$FPlistName ="FilePlan" //failed $RDlist = $web.Lists[$RDlistName] //success $FPlist = $web.Lists[$FPlistName] //empty value Write-host List Name: $RDlist //success Write-host List Name: $FPlist //empty value