I'm trying to get a list, more precisely the Document Library with PowerShell, but I get the following exception and I'm stuck on what I should change:
Exception calling "GetList" with "1" argument(s)
+spDocLib = $spWeb.GetList("Dokumenter")
This is my script code:
function GetDocumentLibrary($completeUrl) {
$web = Get-SPWeb($completeUrl)
$DocumentLibrary = $completeUrl + "/Documentlibrary"
$spSite = Get-SPSite -Identity http://url.com
$spWeb = $spSite.OpenWeb()
$spDocLib = $spWeb.GetList("Dokumenter")
}
Maybe I'm going the wrong way to get to the document library?