1

Just wondering if you could help, I am looking to create a link to a file in a document library, essentially replicating this functionality:

New Link

I was hoping it would be simple to do this using PnP PowerShell I have tried the using the Add-PnPFile however this always expects a stream when running the command below.

Add-PnPFile -FileName "Something.url" -Folder "Folder 1"

Appreciate any help or advice that can be given.

1 Answer 1

3

A demo for your reference:

$stream = [IO.MemoryStream]::new([Text.Encoding]::UTF8.GetBytes("[InternetShortcut]URL=https://www.bing.com")) Add-PnPFile -FileName "Bing.url" -Folder "Shared Documents" -Stream $stream -Values @{_ShortcutUrl="https://www.bing.com"} 

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.