Get PNP List and NO URL!!!!

ComputerHabit 826 Reputation points
2022-03-30T21:51:32.923+00:00

Why can't I get to the URL????

188572-image.png

SharePoint Server
SharePoint Server
A family of Microsoft on-premises document management and storage systems.
2,274 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,078 questions
SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
2,768 questions
0 comments No comments
{count} vote

Accepted answer
  1. Rob Windsor 1,961 Reputation points
    2022-03-31T00:55:36.847+00:00

    I'm not a PowerShell expert, so I'm not sure why the Url property shows when you display the $list object. But as a developer I know that you get the URL for the list from the ServerRelativeUrl property of the root folder.

    188490-image.png

    I hope this helps.

    1 person found this answer helpful.
    0 comments No comments

3 additional answers

Sort by: Most helpful
  1. ComputerHabit 826 Reputation points
    2022-03-31T13:30:58.823+00:00

    I guess I'm just annoyed by lack of consistency.

    1 person found this answer helpful.
    0 comments No comments

  2. ComputerHabit 826 Reputation points
    2022-06-30T21:44:05.433+00:00

    I just got tripped up by this again. I don't code this often.

    I do not get why the people who develop this would post a URL but make you take a completely different path to get to it.

    1 person found this answer helpful.
    0 comments No comments

  3. Echo Du_MSFT 17,126 Reputation points
    2022-03-31T05:08:33.31+00:00

    Hi @ComputerHabit ,

    According to my research, if you want to get the relative path of the SharePoint list, you need to run this command: $List.RootFolder.ServerRelativeUrl

    For example:

    $Site = "https://domain.sharepoint.com/sites/sitename/"  
    Connect-PnPOnline -Url $Site -Credentials (Get-Credential)  
    $ListUrl = "Lists/listname/"      
    #Get the List  
    $List = Get-PnPList -Identity $ListUrl  
    $List  
    $List.Id  
    $List.Title  
    $List.RootFolder.ServerRelativeUrl  
    

    188578-1.jpg

    Thanks,
    Echo Du

    ===============================================

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.