I know we can add link to a document in the document library . Is there a way to do the same using pnp js ?
Asked
Active
Viewed 274 times
1 Answers
0
If you mean can you create a .url file using PnP, the answer is yes. Here is how I did it:
$link = 'https://some-link.com'
$name = 'name this link'
$lib = 'Document Library'
$memoryStream = [IO.MemoryStream]::new([Text.Encoding]::UTF8.GetBytes("[InternetShortcut]`nURL="+$row.link))
Add-PnPFile -FileName $name -Folder $library -Stream $memoryStream -Publish

Donald Koscheka
- 336
- 1
- 6