Published Folders
Universal Dashboard is now a part of PowerShell Universal. This documentation is for reference to the v2 version of Universal Dashboard and is no longer maintained.
PowerShell Universal Documentation can be found here.

Published Folders

Publishing a folder

You can publish a folder by specifying the path to the folder. The RequestPath is the path that the web server will server the files.
1
$Folder = Publish-UDFolder -Path C:\data\ -RequestPath "/config"
2
3
$Dashboard = New-UDDashboard -Title "Published Folders" -Content {}
4
5
Start-UDDashboard -Dashboard $Dashboard -Port 9999 -PublishedFolder $Folder
Copied!
You can download a file by invoking the request path.
1
C:\> Invoke-WebRequest -Uri http://localhost:9999/config/hi.txt
2
3
4
StatusCode : 200
5
StatusDescription : OK
6
Content : Hello
7
RawContent : HTTP/1.1 200 OK
8
Accept-Ranges: bytes
9
Content-Length: 5
10
Content-Type: text/plain
11
Date: Sat, 03 Nov 2018 03:15:34 GMT
12
ETag: "1d473237a178b85"
13
Last-Modified: Sat, 03 Nov 2018 03:15:31 GMT
14
Server: ...
Copied!