/
New-PSUPublishedFolder.txt
143 lines (97 loc) · 5.59 KB
/
New-PSUPublishedFolder.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
NAME
New-PSUPublishedFolder
SYNOPSIS
Creates a new published folder in PowerShell Universal.
SYNTAX
New-PSUPublishedFolder [-AppToken <String>] [-Authentication] [-ComputerName <String>] [-DefaultDocument <String[]>] -Path <String> -RequestPath <String> [-Role <String[]>] [-UseDefaultCredentials] [-Impersonation] [-Integrated] [<CommonParameters>]
DESCRIPTION
Creates a new published folder in PowerShell Universal. Published folders allow you to host files in the PowerShell Universal web server. You can optionally configure authentication, authorization and default documents.
PARAMETERS
-AppToken <String>
The AppToken that is used for calling the PowerShell Universal Management API. You can also call Connect-PSUServer before calling this cmdlet to set the AppToken for the entire session.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-Authentication [<SwitchParameter>]
Specifies whether authentication is required to view files in this published folder. Authentication requires a Dashboard license.
Required? false
Position? named
Default value False
Accept pipeline input? False
Accept wildcard characters? false
-ComputerName <String>
Specifies the computer name or URL that should be called when accessing the PowerShell Universal Management API. You can also use Connect-PSUServer before calling this cmdlet to set the computer name for the entire session.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-DefaultDocument <String[]>
The default document to server when visiting the root of this published folder.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-Path <String>
The local file system path.
Required? true
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-RequestPath <String>
The HTTP request path.
Required? true
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-Role <String[]>
The role to require when viewing files in this published folder. -Authentication is required when using roles.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-UseDefaultCredentials [<SwitchParameter>]
Use default credentials when connecting to the management API
Required? false
Position? named
Default value False
Accept pipeline input? False
Accept wildcard characters? false
-Impersonation [<SwitchParameter>]
Impersonates the connected account when accessing the files. This is only support with Windows Authentication.
Required? false
Position? named
Default value False
Accept pipeline input? False
Accept wildcard characters? false
-Integrated [<SwitchParameter>]
Executes the command internally rather than using the Management API. Only works when running script from within PowerShell Universal.
Required? false
Position? named
Default value False
Accept pipeline input? False
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https://go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
None
OUTPUTS
System.Object
NOTES
-------------------------- Example 1 --------------------------
New-PSUPublishedFolder -RequestPath '/images' -Path 'C:\images'
Publishes the images folder to the request path of images. You will be able to download images from this folder by using URLs like: http://localhost:5000/images/myImage.png
-------------------------- Example 2 --------------------------
New-PSUPublishedFolder -RequestPath '/website' -Path 'C:\website' -DefaultDocument "index.html"
Publishes the website folder and sets the default document to index.html. This allows the you to navigate to the URL http://localhost:5000/website and the web server will return the index.html file automatically. This is helpful for static websites.
RELATED LINKS
Online Version: https://go.microsoft.com/fwlink/?LinkID=217032