I am in the process of moving files to Sharepoint Online. Some of the files will have a share assigned to them (obtained via the ‘Copy Link’ option) in the format
I want to get a list of all links using the PnP Powershell Framework but cannot find the field in the ListItem or File object that contains the information. If i select the file in Sharepoint Online, i can see a link icon which has tooltip ‘1 link giving access’ in the ‘Has Access’ Info panel.
I can get the relative URL information (https://myorg.sharepoint.com/mysite/mydocs/folder1/test.txt)
My script is as follows:
#Get Credentials $creds = Get-Credential -UserName $user -Message "Enter password." #Connect Connect-PnPOnline –Url $site –Credentials $creds #Get All Items to see which one i want Get-PnPListItem -List $docLibrary #get more info for my test file which has ID = 295 $checkItem = Get-PnPListItem -List $docLibrary -Id 295 #See all field values for the check item $checkItem.FieldValues
I cannot see the link information in any of the field values.
I have also tried the File object but again, cannot obviously see where the information is.
$checkFile = Get-PnpFile -Url $link
Note: the $link in the above line is the relative URL
Is this possible using the PnP Framework and do i just need to dig further into the object to get what i need or is it not possible.