I have this code :

$web = Get-SPWeb http://mysite 
ForEach($list in $web.Lists)

if($list.BaseType -eq "DocumentLibrary")
    Write-Host $list.Fields
    if($list.Fields.ContainsField("marking") -eq $true)
        Write-Host "found" $list.Title

I want it to out put the URL of the document library

  • did you try this one $List.DefaultViewUrl? – Waqas Sarwar MVP Jun 9 '14 at 13:54
  • can you put that as an answer as that is what I want – bimbob Jun 9 '14 at 14:01
  • i just post it as anwser – Waqas Sarwar MVP Jun 9 '14 at 14:15

There is another property of List called DefaultViewURL, try that one.


Here is MSDN Article.


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.