How download file from Published Folder with the Dashboard?

I’m trying to make it possible to download the files from the published folder but I can’t get it to work. When the user are clicking on the link nothing happens. If I use the New-UDLink but the New-UDList are more “clean”.

Here is the code;

$Docs = Get-ChildItem -Path D:\Documents\Ex | select-object -ExpandProperty name

        New-UDCard -Title 'Ladda ner' -Content {
            New-UDList -Content {
                foreach ($Doc in $Docs) {
                    New-UDListItem -Label "$Doc" -OnClick {
                        Invoke-WebRequest "https://xxx/doc/ex/$Doc"
Product: PowerShell Universal
Version: 1.4.6

This is because Invoke-WebRequest is running within the PSU server.

Try Invoke-UDRedirect.

Invoke-UDRedirect "https://xxx/doc/ex/$Doc"
1 Like

Ofc, I did a brain fart there

Side Q, is it possible to make the target computer to open the file?

Like in my case it’s .docx files so it would be grate if the user don’t need to open it manually.
When they click on the link the word doc are opening in word on there computer.

Hmmm I’m not sure about this. That might need to be some sort of client or browser configuration to get that to work.

Edge chromium has some function built in for this and I think you can call it.
I’ll look at it on Monday and report back.